Fix `nvm reinstall-packages` for linked packages, broken in 7bce6c6c68
parent
3ef937a64e
commit
be5e8de0c8
8
nvm.sh
8
nvm.sh
|
@ -1765,14 +1765,18 @@ $NVM_LS_REMOTE_IOJS_OUTPUT" | command grep -v "N/A" | sed '/^$/d')"
|
||||||
echo "$INSTALLS" | command xargs npm install -g --quiet
|
echo "$INSTALLS" | command xargs npm install -g --quiet
|
||||||
|
|
||||||
local LINKS
|
local LINKS
|
||||||
LINKS="$(echo "$NPMLIST" | command sed -n 's/.* -> \(.*\)/\1/ p')" # | command sed -e '/^ *$/d;s/.*/"&"/')
|
LINKS="$(echo "$NPMLIST" | command sed -n 's/.* -> \(.*\)/\1/ p')"
|
||||||
|
|
||||||
echo "Linking global packages from $VERSION..."
|
echo "Linking global packages from $VERSION..."
|
||||||
for LINK in "$LINKS"; do
|
set -f; IFS='
|
||||||
|
' # necessary to turn off variable expansion except for newlines
|
||||||
|
for LINK in $LINKS; do
|
||||||
|
set +f; unset IFS # restore variable expansion
|
||||||
if [ -n "$LINK" ]; then
|
if [ -n "$LINK" ]; then
|
||||||
(cd "$LINK" && npm link)
|
(cd "$LINK" && npm link)
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
set +f; unset IFS # restore variable expansion in case $LINKS was empty
|
||||||
;;
|
;;
|
||||||
"clear-cache" )
|
"clear-cache" )
|
||||||
command rm -f $NVM_DIR/v* "$(nvm_version_dir)" 2>/dev/null
|
command rm -f $NVM_DIR/v* "$(nvm_version_dir)" 2>/dev/null
|
||||||
|
|
Loading…
Reference in New Issue