V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 1m57s
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 1m57s
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -161,21 +161,7 @@ yaml_secret() {
|
|||||||
# -N : no "---" doc separators
|
# -N : no "---" doc separators
|
||||||
# -0 : NUL between *each* result
|
# -0 : NUL between *each* result
|
||||||
# shellcheck disable=SC2016,SC2312
|
# shellcheck disable=SC2016,SC2312
|
||||||
exec {__pipe_fd}< <(
|
exec {__pipe_fd}< <( yq -r -N -0 'path(..) as $p | select( $p[0] == "secrets" and $p[-1] == "value" and ((getpath($p) | type) != "object") and ((getpath($p) | type) != "array") ) | ($p[0:-1] | join(".")), ((getpath($p) // "") | tostring)' -- "${secrets_yaml}" )
|
||||||
yq -r -N -0 '
|
|
||||||
def emit($p; $v):
|
|
||||||
if ($v|type) == "object" then
|
|
||||||
($v | to_entries[] | emit(($p + (if $p=="" then "" else "." end) + .key); .value))
|
|
||||||
elif ($v|type) == "array" then
|
|
||||||
(range(0; ($v|length)) | emit(($p + "[" + (tostring) + "]"); $v[.]))
|
|
||||||
else
|
|
||||||
if ($p | endswith(".value")) then
|
|
||||||
($p | sub("\\.value$"; "")), (($v // "") | tostring)
|
|
||||||
else empty end
|
|
||||||
end;
|
|
||||||
(.secrets // empty) | emit("secrets"; .)
|
|
||||||
' -- "${secrets_yaml}"
|
|
||||||
)
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user