stdenv: restore bash options -e/-u to the values they where before

Source https://github.com/akinomyoga/ble.sh/issues/169#issuecomment-1019049032

Author: akinomyoga
This commit is contained in:
Sandro Jäckel 2022-01-23 03:50:09 +01:00
parent f865a2ca89
commit 37fdba0b4f

View file

@ -1,3 +1,4 @@
__nixpkgs_setup_set_original=$-
set -eu
set -o pipefail
shopt -s inherit_errexit
@ -1361,5 +1362,7 @@ runHook userHook
dumpVars
# Disable nounset for nix-shell.
set +u
# Restore the original options for nix-shell
[[ $__nixpkgs_setup_set_original == *e* ]] || set +e
[[ $__nixpkgs_setup_set_original == *u* ]] || set +u
unset -v __nixpkgs_setup_set_original