[Fix] `set -a`: when this option is set, some `sh` shells break
Fixes #2574
parent
d91087c333
commit
b6b6e685a3
7
nvm.sh
7
nvm.sh
|
@ -2661,6 +2661,13 @@ nvm() {
|
|||
EXIT_CODE="$?"
|
||||
set -e
|
||||
return "$EXIT_CODE"
|
||||
elif [ "${-#*a}" != "$-" ]; then
|
||||
set +a
|
||||
local EXIT_CODE
|
||||
IFS="${DEFAULT_IFS}" nvm "$@"
|
||||
EXIT_CODE="$?"
|
||||
set -a
|
||||
return "$EXIT_CODE"
|
||||
elif [ "${IFS}" != "${DEFAULT_IFS}" ]; then
|
||||
IFS="${DEFAULT_IFS}" nvm "$@"
|
||||
return "$?"
|
||||
|
|
Loading…
Reference in New Issue