[Fix] ensure if `npm link` fails, that `$IFS` is not improperly set.
https://github.com/creationix/nvm/issues/1519#issuecomment-297850323
parent
caa7de37af
commit
accd6ae298
3
nvm.sh
3
nvm.sh
|
@ -3157,6 +3157,7 @@ nvm() {
|
|||
nvm_echo "$INSTALLS" | command xargs npm install -g --quiet
|
||||
|
||||
nvm_echo "Linking global packages from $VERSION..."
|
||||
(
|
||||
set -f; IFS='
|
||||
' # necessary to turn off variable expansion except for newlines
|
||||
for LINK in $LINKS; do
|
||||
|
@ -3165,7 +3166,7 @@ nvm() {
|
|||
(nvm_cd "$LINK" && npm link)
|
||||
fi
|
||||
done
|
||||
set +f; unset IFS # restore variable expansion in case $LINKS was empty
|
||||
)
|
||||
;;
|
||||
"clear-cache" )
|
||||
command rm -f "$NVM_DIR/v*" "$(nvm_version_dir)" 2>/dev/null
|
||||
|
|
Loading…
Reference in New Issue