Set inherit_errexit after bash version check

inherit_errexit wasn’t available in bash 3. We have a check to show a
nice error message, but that check is after we set inherit_errexit in
setup.sh. So we can just move this to below the BASH_VERSINFO check.
This commit is contained in:
Matthew Bauer 2022-08-17 15:00:00 -05:00 committed by Yt
parent 7efd61a09a
commit ec4019f6dc

View file

@ -2,7 +2,6 @@
__nixpkgs_setup_set_original=$- __nixpkgs_setup_set_original=$-
set -eu set -eu
set -o pipefail set -o pipefail
shopt -s inherit_errexit
if [[ -n "${BASH_VERSINFO-}" && "${BASH_VERSINFO-}" -lt 4 ]]; then if [[ -n "${BASH_VERSINFO-}" && "${BASH_VERSINFO-}" -lt 4 ]]; then
echo "Detected Bash version that isn't supported by Nixpkgs (${BASH_VERSION})" echo "Detected Bash version that isn't supported by Nixpkgs (${BASH_VERSION})"
@ -10,6 +9,8 @@ if [[ -n "${BASH_VERSINFO-}" && "${BASH_VERSINFO-}" -lt 4 ]]; then
exit 1 exit 1
fi fi
shopt -s inherit_errexit
if (( "${NIX_DEBUG:-0}" >= 6 )); then if (( "${NIX_DEBUG:-0}" >= 6 )); then
set -x set -x
fi fi