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=$-
set -eu
set -o pipefail
shopt -s inherit_errexit
if [[ -n "${BASH_VERSINFO-}" && "${BASH_VERSINFO-}" -lt 4 ]]; then
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
fi
shopt -s inherit_errexit
if (( "${NIX_DEBUG:-0}" >= 6 )); then
set -x
fi