Skip to content

Commit

Permalink
Put node versions >= 0.12 in versions/node instead of just versions
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Jan 14, 2015
1 parent d5e21be commit 0ad5a45
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion nvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ nvm_version_dir() {
local NVM_WHICH_DIR
NVM_WHICH_DIR="$1"
if [ -z "$NVM_WHICH_DIR" ] || [ "_$NVM_WHICH_DIR" = "_new" ]; then
echo "$NVM_DIR/versions"
echo "$NVM_DIR/versions/node"
elif [ "_$NVM_WHICH_DIR" = "_old" ]; then
echo "$NVM_DIR"
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

mkdir -p ../../../v0.0.2
mkdir -p ../../../v0.0.20
mkdir -p ../../../versions/v0.12.0
mkdir -p ../../../versions/node/v0.12.0

. ../../../nvm.sh

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

mkdir ../../../v0.1.3
mkdir ../../../v0.2.3
mkdir ../../../versions
mkdir -p ../../../versions/node

. ../../../nvm.sh

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

die () { echo $@ ; exit 1; }

mkdir -p ../../../versions/v0.12.1
mkdir -p ../../../versions/node/v0.12.1
mkdir ../../../v0.1.3

. ../../../nvm.sh
Expand Down
2 changes: 1 addition & 1 deletion test/fast/Unit tests/nvm_version_dir
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ die () { echo $@ ; exit 1; }

. ../../../nvm.sh

[ "$(nvm_version_dir)" = "$NVM_DIR/versions" ] || die '"nvm_version_dir" did not return new dir path'
[ "$(nvm_version_dir)" = "$NVM_DIR/versions/node" ] || die '"nvm_version_dir" did not return new dir path'
[ "$(nvm_version_dir new)" = "$(nvm_version_dir)" ] || die '"nvm_version_dir new" did not return new dir path'
[ "$(nvm_version_dir old)" = "$NVM_DIR" ] || die '"nvm_version_dir old" did not return old dir path'
[ "$(nvm_version_dir foo 2>&1)" = "unknown version dir" ] || die '"nvm_version_dir foo" did not error out'
Expand Down
2 changes: 1 addition & 1 deletion test/fast/Unit tests/nvm_version_path
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ die () { echo $@ ; exit 1; }
[ "$(nvm_version_path foo)" = "$NVM_DIR/foo" ] || die '"nvm_version_path foo" did not return correct location'
[ "$(nvm_version_path 2>&1)" = "version is required" ] || die '"nvm_version_path" did not error out'
[ "$(nvm_version_path v0.11.0)" = "$NVM_DIR/v0.11.0" ] || die 'old version has the wrong path'
[ "$(nvm_version_path v0.12.0)" = "$NVM_DIR/versions/v0.12.0" ] || die 'new version has the wrong path'
[ "$(nvm_version_path v0.12.0)" = "$NVM_DIR/versions/node/v0.12.0" ] || die 'new version has the wrong path'

0 comments on commit 0ad5a45

Please sign in to comment.