mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-09-08 07:10:04 +00:00
Properly outputting the version when nvm_version_path outputs the new "versions" subdirectory.
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
mkdir ../../../v0.0.2
|
||||
mkdir ../../../v0.0.20
|
||||
mkdir -p ../../../v0.0.2
|
||||
mkdir -p ../../../v0.0.20
|
||||
mkdir -p ../../../versions/v0.12.0
|
||||
|
||||
. ../../../nvm.sh
|
||||
|
||||
@@ -9,13 +10,18 @@ die () { echo $@ ; exit 1; }
|
||||
|
||||
# The result should contain only the appropriate version numbers.
|
||||
|
||||
nvm which 0.0.2
|
||||
nvm which 0.0.2 | grep "$NVM_DIR/v0.0.2/bin/node" > /dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
die '"nvm which 0.0.2" did not contain the correct path'
|
||||
fi
|
||||
nvm which 0.0.2 || die "v0.0.2 not found"
|
||||
NVM_BIN="$(nvm which 0.0.2)"
|
||||
[ "_$NVM_BIN" = "_$(nvm_version_path v0.0.2)/bin/node" ] \
|
||||
|| die "'nvm which 0.0.2' did not contain the correct path: got '$NVM_BIN'"
|
||||
|
||||
nvm which 0.0.20 || die "v0.0.20 not found"
|
||||
NVM_BIN="$(nvm which 0.0.20)"
|
||||
[ "_$NVM_BIN" = "_$(nvm_version_path v0.0.20)/bin/node" ] \
|
||||
|| die "'nvm which 0.20.0' did not contain the correct path: got '$NVM_BIN'"
|
||||
|
||||
nvm which 0.12.0 || die "v0.0.20 not found"
|
||||
NVM_BIN="$(nvm which 0.12.0)"
|
||||
[ "_$NVM_BIN" = "_$(nvm_version_path v0.12.0)/bin/node" ] \
|
||||
|| die "'nvm which 0.12.0' did not contain the correct path: got '$NVM_BIN'"
|
||||
|
||||
nvm which 0.0.20 | grep "$NVM_DIR/v0.0.20/bin/node" > /dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
die '"nvm which 0.0.2" did not contain the correct path'
|
||||
fi
|
||||
|
Reference in New Issue
Block a user