Include npm version when displaying results of switch.
When running nvm use, successful changing of versions lists the new node version. The npm version may also be switched, but this is not listed. This commit updates nvm to display the npm version that was switched to alongside the node versionmaster
parent
276d55c912
commit
e01bcb740b
9
nvm.sh
9
nvm.sh
|
@ -1360,10 +1360,10 @@ nvm() {
|
||||||
|
|
||||||
if [ "_$VERSION" = '_system' ]; then
|
if [ "_$VERSION" = '_system' ]; then
|
||||||
if nvm_has_system_node && nvm deactivate >/dev/null 2>&1; then
|
if nvm_has_system_node && nvm deactivate >/dev/null 2>&1; then
|
||||||
echo "Now using system version of node: $(node -v 2>/dev/null)."
|
echo "Now using system version of node: $(node -v 2>/dev/null) (npm v$(npm --version 2>/dev/null))"
|
||||||
return
|
return
|
||||||
elif nvm_has_system_iojs && nvm deactivate >/dev/null 2>&1; then
|
elif nvm_has_system_iojs && nvm deactivate >/dev/null 2>&1; then
|
||||||
echo "Now using system version of io.js: $(iojs --version 2>/dev/null)."
|
echo "Now using system version of io.js: $(iojs --version 2>/dev/null) (npm v$(npm --version 2>/dev/null))"
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
echo "System version of node not found." >&2
|
echo "System version of node not found." >&2
|
||||||
|
@ -1407,10 +1407,11 @@ nvm() {
|
||||||
command rm -f "$NVM_DIR/current" && ln -s "$NVM_VERSION_DIR" "$NVM_DIR/current"
|
command rm -f "$NVM_DIR/current" && ln -s "$NVM_VERSION_DIR" "$NVM_DIR/current"
|
||||||
fi
|
fi
|
||||||
if nvm_is_iojs_version "$VERSION"; then
|
if nvm_is_iojs_version "$VERSION"; then
|
||||||
echo "Now using io.js $(nvm_strip_iojs_prefix "$VERSION")"
|
echo -n "Now using io.js $(nvm_strip_iojs_prefix "$VERSION")"
|
||||||
else
|
else
|
||||||
echo "Now using node $VERSION"
|
echo -n "Now using node $VERSION"
|
||||||
fi
|
fi
|
||||||
|
echo " (npm v$(npm --version 2>/dev/null))"
|
||||||
;;
|
;;
|
||||||
"run" )
|
"run" )
|
||||||
local provided_version
|
local provided_version
|
||||||
|
|
Loading…
Reference in New Issue