Create nvm_version_path
parent
6baa9a0918
commit
986abbf5db
10
nvm.sh
10
nvm.sh
|
@ -95,6 +95,16 @@ nvm_rc_version() {
|
|||
fi
|
||||
}
|
||||
|
||||
nvm_version_path() {
|
||||
local VERSION
|
||||
VERSION="$1"
|
||||
if [ -z "$VERSION" ]; then
|
||||
echo "$NVM_DIR"
|
||||
elif [ ! -z "$VERSION" ]; then
|
||||
echo "$NVM_DIR/$VERSION"
|
||||
fi
|
||||
}
|
||||
|
||||
# Expand a version using the version cache
|
||||
nvm_version() {
|
||||
local PATTERN
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
#!/bin/sh
|
||||
|
||||
die () { echo $@ ; exit 1; }
|
||||
|
||||
. ../../../nvm.sh
|
||||
|
||||
[ "$(nvm_version_path)" = "$NVM_DIR" ] &&
|
||||
[ "$(nvm_version_path foo)" = "$NVM_DIR/foo" ]
|
||||
|
Loading…
Reference in New Issue