Skip to content
Myr

Merge pull request #192 from gpad/nvmrc

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

Use .nvmrc if present

authored by Tim Caswell · committed by Tim Caswell · parents f605581, 7226e5f · Browse files · 1 file+21 added−1 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+21 added−1 removed

  • other:+21 added−1 removed

1 file+21 added−1 removed

modified:nvm.sh+21 added-1 removed
14 unmodified lines
15if [ ! -z "$(which unsetopt 2>/dev/null)" ]; then16 unsetopt nomatch 2>/dev/null17fi1819# Obtain nvm version from rc file20function rc_nvm_version {21 if [ -e .nvmrc ]; then22 RC_VERSION=`cat .nvmrc | head -n 1`23 echo "Found .nvmrc files with version <$RC_VERSION>"24 fi25}2627# Expand a version using the version cache28nvm_version()29{30 local PATTERN=$1
320 unmodified lines
351 echo "Could not find $NVM_DIR/*/share/man in \$MANPATH"352 fi353 ;;354 "use" )347 if [ $# -ne 2 ]; then355 if [ $# -eq 0 ]; then356 nvm help357 return358 fi359 if [ $# -eq 1 ]; then360 rc_nvm_version361 if [ ! -z $RC_VERSION ]; then362 VERSION=`nvm_version $RC_VERSION`363 fi364 else365 VERSION=`nvm_version $2`366 fi367 if [ -z $VERSION ]; then368 nvm help369 return370 fi371 VERSION=`nvm_version $2`372 if [ ! -d $NVM_DIR/$VERSION ]; then373 echo "$VERSION version is not installed yet"374 return 1
106 unmodified lines