[Fix] set -E: Add test for node install on Bash with an ERR trap and set -E

This commit is contained in:
Luke Arms authored and Jordan Harband committed 2021-12-27 16:02:25 +11:00
1 parent fb4538b360
commit 81f0f3ec19
2 files changed
+59

No files matched your search

+9
View File
@@ -2742,6 +2742,15 @@ nvm() {
EXIT_CODE="$?"
set -a
return "$EXIT_CODE"
elif [ -n "${BASH-}" ] && [ "${-#*E}" != "$-" ]; then
# shellcheck disable=SC3041
set +E
local EXIT_CODE
IFS="${DEFAULT_IFS}" nvm "$@"
EXIT_CODE="$?"
# shellcheck disable=SC3041
set -E
return "$EXIT_CODE"
elif [ "${IFS}" != "${DEFAULT_IFS}" ]; then
IFS="${DEFAULT_IFS}" nvm "$@"
return "$?"