Add `nvm_node_prefix`

master
Jordan Harband 2015-01-13 14:16:35 -08:00
parent 8be97c8abb
commit c46748a379
2 changed files with 11 additions and 1 deletions

5
nvm.sh
View File

@ -350,6 +350,9 @@ nvm_resolve_alias() {
nvm_iojs_prefix() { nvm_iojs_prefix() {
echo "iojs" echo "iojs"
} }
nvm_node_prefix() {
echo "node"
}
nvm_ls() { nvm_ls() {
local PATTERN local PATTERN
@ -1194,7 +1197,7 @@ nvm() {
;; ;;
"unload" ) "unload" )
unset -f nvm nvm_print_versions nvm_checksum \ unset -f nvm nvm_print_versions nvm_checksum \
nvm_iojs_prefix \ nvm_iojs_prefix nvm_node_prefix \
nvm_ls_remote nvm_ls nvm_remote_version \ nvm_ls_remote nvm_ls nvm_remote_version \
nvm_version nvm_rc_version \ nvm_version nvm_rc_version \
nvm_version_greater nvm_version_greater_than_or_equal_to \ nvm_version_greater nvm_version_greater_than_or_equal_to \

View File

@ -0,0 +1,7 @@
#!/bin/sh
die () { echo $@ ; exit 1; }
. ../../../nvm.sh
[ "$(nvm_node_prefix)" = "node" ] || die '"nvm_node_prefix" did not return the string "node". why did this fail?!'