Use `NVM_VERSION` instead of `VERSION` to be a bit less intrusive.

Fixes #820.
Jordan Harband 2015-09-07 21:43:21 +09:00
parent 0d898b0aa4
commit 0ef20199dc
1 changed files with 5 additions and 5 deletions

10
nvm.sh
View File

@ -1992,15 +1992,15 @@ nvm_supports_source_options() {
[ "_$(echo 'echo $1' | . /dev/stdin yes 2> /dev/null)" = "_yes" ]
}
VERSION="$(nvm_alias default 2>/dev/null || echo)"
NVM_VERSION="$(nvm_alias default 2>/dev/null || echo)"
if nvm_supports_source_options && [ "_$1" = "_--install" ]; then
if [ -n "$VERSION" ]; then
nvm install "$VERSION" >/dev/null
if [ -n "$NVM_VERSION" ]; then
nvm install "$NVM_VERSION" >/dev/null
elif nvm_rc_version >/dev/null 2>&1; then
nvm install >/dev/null
fi
elif [ -n "$VERSION" ]; then
nvm use --silent "$VERSION" >/dev/null
elif [ -n "$NVM_VERSION" ]; then
nvm use --silent "$NVM_VERSION" >/dev/null
elif nvm_rc_version >/dev/null 2>&1; then
nvm use --silent >/dev/null
fi