[Fix] `set -u`: `nvm use`: ensure these two vars don’t error out.

Fixes #1587.
Jordan Harband 2017-08-08 00:05:38 -07:00
parent 248706d5f8
commit 389a53cca9
1 changed files with 2 additions and 2 deletions

4
nvm.sh
View File

@ -2807,9 +2807,9 @@ nvm() {
if [ -n "${NVM_LTS-}" ]; then if [ -n "${NVM_LTS-}" ]; then
VERSION="$(nvm_match_version "lts/${NVM_LTS:-*}")" VERSION="$(nvm_match_version "lts/${NVM_LTS:-*}")"
elif [ -z "$PROVIDED_VERSION" ]; then elif [ -z "${PROVIDED_VERSION-}" ]; then
nvm_rc_version nvm_rc_version
if [ -n "$NVM_RC_VERSION" ]; then if [ -n "${NVM_RC_VERSION-}" ]; then
PROVIDED_VERSION="$NVM_RC_VERSION" PROVIDED_VERSION="$NVM_RC_VERSION"
VERSION="$(nvm_version "$PROVIDED_VERSION")" VERSION="$(nvm_version "$PROVIDED_VERSION")"
fi fi