nvm run: use common code path for "ensure version installed"

Better than cb033adc6f
Jordan Harband 2015-10-08 16:46:16 -07:00
parent a0e94e16de
commit 937c29c95a
1 changed files with 4 additions and 11 deletions

15
nvm.sh
View File

@ -1876,16 +1876,6 @@ nvm() {
fi
fi
if [ -n "$NVM_RC_VERSION" ]; then
nvm_ensure_version_installed "$NVM_RC_VERSION"
else
nvm_ensure_version_installed "$provided_version"
fi
EXIT_CODE=$?
if [ "$EXIT_CODE" != "0" ]; then
return $EXIT_CODE
fi
local NVM_IOJS
if nvm_is_iojs_version "$VERSION"; then
NVM_IOJS=true
@ -1902,7 +1892,10 @@ nvm() {
ZHS_HAS_SHWORDSPLIT_UNSET=$(setopt | command grep shwordsplit > /dev/null ; echo $?)
setopt shwordsplit
fi
if [ -z "$ARGS" ]; then
if [ "_$VERSION" = "_N/A" ]; then
nvm_ensure_version_installed "$provided_version"
EXIT_CODE=$?
elif [ -z "$ARGS" ]; then
if [ "$NVM_IOJS" = true ]; then
nvm exec "$VERSION" iojs
else