Use nvm_version_dir in nvm_version_path
parent
9068dda110
commit
a2da9abd6d
5
nvm.sh
5
nvm.sh
|
@ -112,9 +112,10 @@ nvm_version_path() {
|
|||
local VERSION
|
||||
VERSION="$1"
|
||||
if [ -z "$VERSION" ]; then
|
||||
echo "$NVM_DIR"
|
||||
echo "version is required" >&2
|
||||
return 3
|
||||
elif [ ! -z "$VERSION" ]; then
|
||||
echo "$NVM_DIR/$VERSION"
|
||||
echo "$(nvm_version_dir old)/$VERSION"
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,6 @@ die () { echo $@ ; exit 1; }
|
|||
|
||||
. ../../../nvm.sh
|
||||
|
||||
[ "$(nvm_version_path)" = "$NVM_DIR" ] &&
|
||||
[ "$(nvm_version_path foo)" = "$NVM_DIR/foo" ]
|
||||
[ "$(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'
|
||||
|
||||
|
|
Loading…
Reference in New Issue