Fix `npm` version output for `nvm run` and `nvm exec`

Jordan Harband 2015-11-10 23:31:16 -08:00
parent e10705b896
commit c742ab7e66
1 changed files with 3 additions and 3 deletions

6
nvm.sh
View File

@ -1936,11 +1936,11 @@ nvm() {
fi fi
EXIT_CODE="$?" EXIT_CODE="$?"
elif [ "$NVM_IOJS" = true ]; then elif [ "$NVM_IOJS" = true ]; then
[ $NVM_SILENT -eq 1 ] || echo "Running io.js $(nvm_strip_iojs_prefix "$VERSION")$(nvm_print_npm_version)" [ $NVM_SILENT -eq 1 ] || echo "Running io.js $(nvm_strip_iojs_prefix "$VERSION")$(nvm use --silent "$VERSION" && nvm_print_npm_version)"
OUTPUT="$(nvm use "$VERSION" >/dev/null && iojs $ARGS)" OUTPUT="$(nvm use "$VERSION" >/dev/null && iojs $ARGS)"
EXIT_CODE="$?" EXIT_CODE="$?"
else else
[ $NVM_SILENT -eq 1 ] || echo "Running node $VERSION$(nvm_print_npm_version)" [ $NVM_SILENT -eq 1 ] || echo "Running node $VERSION$(nvm use --silent "$VERSION" && nvm_print_npm_version)"
OUTPUT="$(nvm use "$VERSION" >/dev/null && node $ARGS)" OUTPUT="$(nvm use "$VERSION" >/dev/null && node $ARGS)"
EXIT_CODE="$?" EXIT_CODE="$?"
fi fi
@ -1985,7 +1985,7 @@ nvm() {
return $EXIT_CODE return $EXIT_CODE
fi fi
[ $NVM_SILENT -eq 1 ] || echo "Running node $VERSION$(nvm_print_npm_version)" [ $NVM_SILENT -eq 1 ] || echo "Running node $VERSION$(nvm use --silent "$VERSION" && nvm_print_npm_version)"
NODE_VERSION="$VERSION" "$NVM_DIR/nvm-exec" "$@" NODE_VERSION="$VERSION" "$NVM_DIR/nvm-exec" "$@"
;; ;;
"ls" | "list" ) "ls" | "list" )