Only filter the package npm, not any package name contains 'npm'

master
HE Shi-Jun 2015-03-11 18:12:01 +08:00
parent 2b63f37f8d
commit bf7bd3e793
1 changed files with 2 additions and 2 deletions

4
nvm.sh
View File

@ -1658,11 +1658,11 @@ $NVM_LS_REMOTE_IOJS_OUTPUT" | command grep -v "N/A" | sed '/^$/d')"
echo 'No system version of node or io.js detected.' >&2
return 3
fi
INSTALLS=$(nvm deactivate > /dev/null && npm list -g --depth=0 | command tail -n +2 | command grep -o -e ' [^@]*' | command cut -c 2- | command grep -v npm | command xargs)
INSTALLS=$(nvm deactivate > /dev/null && npm list -g --depth=0 | command tail -n +2 | command grep -o -e ' [^@]*' | command cut -c 2- | command grep -vx npm | command xargs)
else
local VERSION
VERSION="$(nvm_version "$PROVIDED_VERSION")"
INSTALLS=$(nvm use "$VERSION" > /dev/null && npm list -g --depth=0 | command tail -n +2 | command grep -o -e ' [^@]*' | command cut -c 2- | command grep -v npm | command xargs)
INSTALLS=$(nvm use "$VERSION" > /dev/null && npm list -g --depth=0 | command tail -n +2 | command grep -o -e ' [^@]*' | command cut -c 2- | command grep -vx npm | command xargs)
fi
echo "Copying global packages from $VERSION..."