From 0ef20199dcf6d4a21226a66cb8eccf23c6e16c7a Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Mon, 7 Sep 2015 21:43:21 +0900 Subject: [PATCH] Use `NVM_VERSION` instead of `VERSION` to be a bit less intrusive. Fixes #820. --- nvm.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nvm.sh b/nvm.sh index 9602c04..a68a0c7 100755 --- a/nvm.sh +++ b/nvm.sh @@ -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