[Performance] make auto-using faster.

Per https://github.com/creationix/nvm/issues/539#issuecomment-236830764
This commit is contained in:
Jordan Harband 2016-08-02 00:59:51 -07:00
parent f653bdc606
commit f9f140ec13
No known key found for this signature in database
GPG Key ID: 64A196AEE0916D55

2
nvm.sh
View File

@ -2824,7 +2824,7 @@ nvm_auto() {
nvm install >/dev/null
fi
elif [ "_$NVM_MODE" = '_use' ]; then
VERSION="$(nvm_alias default 2>/dev/null || nvm_echo)"
VERSION="$(nvm_resolve_local_alias default 2>/dev/null || nvm_echo)"
if [ -n "$VERSION" ]; then
nvm use --silent "$VERSION" >/dev/null
elif nvm_rc_version >/dev/null 2>&1; then