[Fix] do not print help text on sourcing when an empty .nvmrc file is found.
Fixes #1113.
parent
45ae48df2d
commit
36b1ea9236
7
nvm.sh
7
nvm.sh
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue