Skip to content

Commit

Permalink
[Fix] Handle 'N/A' version instead of asking to install it, fix #1304
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterDaveHello committed Nov 14, 2016
1 parent fd33179 commit 514f662
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions nvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2627,6 +2627,11 @@ nvm() {
return 8
fi

VERSION="$(NVM_VERSION_ONLY=true nvm_remote_version "${PROVIDED_VERSION}")"
if [ "${VERSION}" = 'N/A' ]; then
nvm_err "Version '$PROVIDED_VERSION' not found - try \`nvm ls-remote\` to browse available versions."
return 3
fi
# This nvm_ensure_version_installed call can be a performance bottleneck
# on shell startup. Perhaps we can optimize it away or make it faster.
if ! nvm_ensure_version_installed "${VERSION}"; then
Expand Down

0 comments on commit 514f662

Please sign in to comment.