Make sure that `nvm reinstall-packages system` has the right std output.

master
Jordan Harband 2015-05-08 14:15:42 -07:00
parent f70530ef18
commit 94bba31de3
1 changed files with 2 additions and 1 deletions

3
nvm.sh
View File

@ -1712,14 +1712,15 @@ $NVM_LS_REMOTE_IOJS_OUTPUT" | command grep -v "N/A" | sed '/^$/d')"
fi
local NPMLIST
local VERSION
if [ "_$PROVIDED_VERSION" = "_system" ]; then
if ! nvm_has_system_node && ! nvm_has_system_iojs; then
echo 'No system version of node or io.js detected.' >&2
return 3
fi
VERSION="system"
NPMLIST=$(nvm deactivate > /dev/null && npm list -g --depth=0 | command tail -n +2)
else
local VERSION
VERSION="$(nvm_version "$PROVIDED_VERSION")"
NPMLIST=$(nvm use "$VERSION" > /dev/null && npm list -g --depth=0 | command tail -n +2)
fi