Skip to content

Commit b6b6e68

Browse files
committed
[Fix] set -a: when this option is set, some sh shells break
Fixes #2574
1 parent d91087c commit b6b6e68

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

nvm.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2661,6 +2661,13 @@ nvm() {
26612661
EXIT_CODE="$?"
26622662
set -e
26632663
return "$EXIT_CODE"
2664+
elif [ "${-#*a}" != "$-" ]; then
2665+
set +a
2666+
local EXIT_CODE
2667+
IFS="${DEFAULT_IFS}" nvm "$@"
2668+
EXIT_CODE="$?"
2669+
set -a
2670+
return "$EXIT_CODE"
26642671
elif [ "${IFS}" != "${DEFAULT_IFS}" ]; then
26652672
IFS="${DEFAULT_IFS}" nvm "$@"
26662673
return "$?"

0 commit comments

Comments
 (0)