Skip to content

Commit

Permalink
Merge branch 'master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
milesfrain authored May 1, 2023
2 parents 63f0cdc + c08b38a commit b6ab4f0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions nvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,11 @@ nvm_is_version_installed() {

nvm_print_npm_version() {
if nvm_has "npm"; then
command printf " (npm v$(npm --version 2>/dev/null))"
local NPM_VERSION
NPM_VERSION="$(npm --version 2>/dev/null)"
if [ -n "${NPM_VERSION}" ]; then
command printf " (npm v${NPM_VERSION})"
fi
fi
}

Expand Down Expand Up @@ -1130,7 +1134,7 @@ nvm_ls_current() {
if [ "${VERSION}" = "v0.6.21-pre" ]; then
nvm_echo 'v0.6.21'
else
nvm_echo "${VERSION}"
nvm_echo "${VERSION:-none}"
fi
else
nvm_echo 'system'
Expand Down

0 comments on commit b6ab4f0

Please sign in to comment.