Skip to content
Myr

Ensure that `nvm use` works when .nvmrc contains "system"

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

authored by Jordan Harband · committed by Jordan Harband · parent d5fe657 · Browse files · 1 file+13 added−13 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+13 added−13 removed

  • other:+13 added−13 removed

1 file+13 added−13 removed

modified:nvm.sh+13 added-13 removed
664 unmodified lines
665 nvm_rc_version666 if [ -n "$NVM_RC_VERSION" ]; then667 VERSION=`nvm_version $NVM_RC_VERSION`668 fi669 elif [ "_$2" != '_system' ]; then670 VERSION="$(nvm_version "$2")"671 else670 if [ $2 = 'system' ]; then671 if nvm_has_system_node && nvm deactivate >/dev/null; then672 echo "Now using system version of node: $(node -v 2>/dev/null)."673 return674 else675 echo "System version of node not found." >&2676 return 127677 fi678 else679 VERSION=`nvm_version $2`680 fi672 VERSION="$2"673 fi674 if [ -z "$VERSION" ]; then675 nvm help676 return 127677 fi686 if [ -z "$VERSION" ]; then687 VERSION=`nvm_version $2`678679 if [ "_$VERSION" = '_system' ]; then680 if nvm_has_system_node && nvm deactivate >/dev/null; then681 echo "Now using system version of node: $(node -v 2>/dev/null)."682 return683 else684 echo "System version of node not found." >&2685 return 127686 fi687 fi688689 local NVM_VERSION_DIR690 NVM_VERSION_DIR="$(nvm_version_path "$VERSION")"691 if [ ! -d "$NVM_VERSION_DIR" ]; then692 echo "$VERSION version is not installed yet" >&2
214 unmodified lines