[Fix] do not print help text on sourcing when an empty .nvmrc file is found.

Fixes #1113.
Jordan Harband 2016-06-14 09:57:37 -07:00
parent 45ae48df2d
commit 36b1ea9236
No known key found for this signature in database
GPG Key ID: 64A196AEE0916D55
1 changed files with 6 additions and 1 deletions

7
nvm.sh
View File

@ -166,7 +166,12 @@ nvm_rc_version() {
NVMRC_PATH="$(nvm_find_nvmrc)" NVMRC_PATH="$(nvm_find_nvmrc)"
if [ -e "$NVMRC_PATH" ]; then if [ -e "$NVMRC_PATH" ]; then
read -r NVM_RC_VERSION < "$NVMRC_PATH" || printf '' read -r NVM_RC_VERSION < "$NVMRC_PATH" || printf ''
nvm_echo "Found '$NVMRC_PATH' with version <$NVM_RC_VERSION>" if [ -n "$NVM_RC_VERSION" ]; then
nvm_echo "Found '$NVMRC_PATH' with version <$NVM_RC_VERSION>"
else
nvm_err "Warning: empty .nvmrc file found at \"$NVMRC_PATH\""
return 2
fi
else else
nvm_err "No .nvmrc file found" nvm_err "No .nvmrc file found"
return 1 return 1