[Fix] attempt to fix a bug in bash 3.2, fixed in 4.4, that improperly exits on `-e` in a test.
See https://gist.github.com/ljharb/6e70a79ac5fcf11a8b9de654a88642aa for details.
parent
2a5d2c06ff
commit
58d0933f72
9
nvm.sh
9
nvm.sh
|
@ -2300,7 +2300,14 @@ nvm() {
|
||||||
local DEFAULT_IFS
|
local DEFAULT_IFS
|
||||||
DEFAULT_IFS=" $(nvm_echo t | command tr t \\t)
|
DEFAULT_IFS=" $(nvm_echo t | command tr t \\t)
|
||||||
"
|
"
|
||||||
if [ "${IFS}" != "${DEFAULT_IFS}" ]; then
|
if [ "${-#*e}" != "$-" ]; then
|
||||||
|
set +e
|
||||||
|
local EXIT_CODE
|
||||||
|
IFS="${DEFAULT_IFS}" nvm "$@"
|
||||||
|
EXIT_CODE=$?
|
||||||
|
set -e
|
||||||
|
return $EXIT_CODE
|
||||||
|
elif [ "${IFS}" != "${DEFAULT_IFS}" ]; then
|
||||||
IFS="${DEFAULT_IFS}" nvm "$@"
|
IFS="${DEFAULT_IFS}" nvm "$@"
|
||||||
return $?
|
return $?
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue