Skip to content
Myr

Merge pull request #374 from koenpunt/fix-tests

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

Fix NVM_DIR discovery

authored by Jordan Harband · committed by Jordan Harband · parents cebda7d, 4a9a15c · Browse files · 1 file+8 added−5 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+8 added−5 removed

  • other:+8 added−5 removed

1 file+8 added−5 removed

modified:nvm.sh+8 added-5 removed
3 unmodified lines
4#5# Implemented by Tim Caswell <tim@creationix.com>6# with much bash help from Matthew Ranney78SCRIPT_SOURCE="$_"910nvm_has() {11 type "$1" > /dev/null 2>&112 return $?13}
4 unmodified lines
18 unsetopt nomatch 2>/dev/null19 NVM_CD_FLAGS="-q"20fi2120# Auto detect the NVM_DIR21if [ ! -d "$NVM_DIR" ]; then22# Auto detect the NVM_DIR when not set23if [ -z "$NVM_DIR" ]; then24 if [ -n "$BASH_SOURCE" ]; then23 export NVM_DIR=$(cd $NVM_CD_FLAGS $(dirname ${BASH_SOURCE[0]:-$0}) > /dev/null && pwd)24 else25 export NVM_DIR=$HOME/.nvm25 SCRIPT_SOURCE="${BASH_SOURCE[0]}"26 fi27 export NVM_DIR=$(cd $NVM_CD_FLAGS $(dirname "${SCRIPT_SOURCE:-$0}") > /dev/null && pwd)28fi29unset SCRIPT_SOURCE 2> /dev/null303132# Setup mirror location if not already set33if [ -z "$NVM_NODEJS_ORG_MIRROR" ]; then34 export NVM_NODEJS_ORG_MIRROR="http://nodejs.org/dist"35fi
524 unmodified lines