Skip to content
Myr

[performance] `nvm_auto`: only call `nvm_ls_current` in `use` mode

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Michael Potter · committed by Jordan Harband · parent 19c55b9 · Browse files · 1 file+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−2 removed

  • other:+2 added−2 removed

1 file+2 added−2 removed

modified:nvm.sh+2 added-2 removed
3786 unmodified lines
3787 return $?3788}37893790nvm_auto() {3791 local NVM_CURRENT3792 NVM_CURRENT="$(nvm_ls_current)"3791 local NVM_MODE3792 NVM_MODE="${1-}"3793 local VERSION3794 local NVM_CURRENT3795 if [ "_${NVM_MODE}" = '_install' ]; then3796 VERSION="$(nvm_alias default 2>/dev/null || nvm_echo)"3797 if [ -n "${VERSION}" ]; then3798 nvm install "${VERSION}" >/dev/null3799 elif nvm_rc_version >/dev/null 2>&1; then3800 nvm install >/dev/null3801 fi3802 elif [ "_$NVM_MODE" = '_use' ]; then3803 NVM_CURRENT="$(nvm_ls_current)"3804 if [ "_${NVM_CURRENT}" = '_none' ] || [ "_${NVM_CURRENT}" = '_system' ]; then3805 VERSION="$(nvm_resolve_local_alias default 2>/dev/null || nvm_echo)"3806 if [ -n "${VERSION}" ]; then3807 nvm use --silent "${VERSION}" >/dev/null
30 unmodified lines