genJqSecretsReplacementSnippet: Fix error handling
With the previous change that enabled error propagation through `inherit_errexit`, the script would fail if `errexit` was set, but `inherit_errexit` was not. This is due to `shopt -p` exiting with an error if the option is disabled. To work around this, use the exit code instead of the text value returned by `shopt -p`. Fixes #160869.
This commit is contained in:
parent
96cd003963
commit
b549e7bbb5
1 changed files with 3 additions and 2 deletions
|
@ -150,7 +150,8 @@ rec {
|
|||
rm '${output}'
|
||||
fi
|
||||
|
||||
inherit_errexit_restore=$(shopt -p inherit_errexit)
|
||||
inherit_errexit_enabled=0
|
||||
shopt -pq inherit_errexit && inherit_errexit_enabled=1
|
||||
shopt -s inherit_errexit
|
||||
''
|
||||
+ concatStringsSep
|
||||
|
@ -170,7 +171,7 @@ rec {
|
|||
' <<'EOF'
|
||||
${builtins.toJSON set}
|
||||
EOF
|
||||
$inherit_errexit_restore
|
||||
(( ! $inherit_errexit_enabled )) && shopt -u inherit_errexit
|
||||
'';
|
||||
|
||||
systemdUtils = {
|
||||
|
|
Loading…
Reference in a new issue