Add a way to load a specific version of node during shell startup

This allows avoiding `nvm_resolve_local_alias default` which can be
fairly slow on underpowered machines.
This commit is contained in:
James Nylen 2018-02-20 08:50:26 +00:00
parent f5b5f2d41d
commit 4821d22077

3
nvm.sh
View File

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