Add `nvm_add_iojs_prefix`
parent
c12104cecd
commit
b7983842aa
6
nvm.sh
6
nvm.sh
|
@ -358,6 +358,10 @@ nvm_is_iojs_version() {
|
|||
[ "_$(echo "$1" | cut -c1-5)" = "_iojs-" ]
|
||||
}
|
||||
|
||||
nvm_add_iojs_prefix() {
|
||||
command echo "$(nvm_iojs_prefix)-$(nvm_ensure_version_prefix "$(nvm_strip_iojs_prefix "$1")")"
|
||||
}
|
||||
|
||||
nvm_strip_iojs_prefix() {
|
||||
local NVM_IOJS_PREFIX
|
||||
NVM_IOJS_PREFIX="$(nvm_iojs_prefix)"
|
||||
|
@ -1212,7 +1216,7 @@ nvm() {
|
|||
"unload" )
|
||||
unset -f nvm nvm_print_versions nvm_checksum \
|
||||
nvm_iojs_prefix nvm_node_prefix \
|
||||
nvm_strip_iojs_prefix \
|
||||
nvm_add_iojs_prefix nvm_strip_iojs_prefix \
|
||||
nvm_is_iojs_version \
|
||||
nvm_ls_remote nvm_ls nvm_remote_version \
|
||||
nvm_version nvm_rc_version \
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
#!/bin/sh
|
||||
|
||||
die () { echo $@ ; exit 1; }
|
||||
|
||||
. ../../../nvm.sh
|
||||
|
||||
[ "_$(nvm_add_iojs_prefix 1)" = "_iojs-v1" ] || die '"nvm_add_iojs_prefix 1" did not return "iojs-v1"'
|
||||
[ "_$(nvm_add_iojs_prefix iojs-1)" = "_iojs-v1" ] || die '"nvm_add_iojs_prefix iojs-1" did not return "iojs-v1"'
|
||||
[ "_$(nvm_add_iojs_prefix iojs-1.2.3)" = "_iojs-v1.2.3" ] || die '"nvm_add_iojs_prefix iojs-1.2.3" did not return "iojs-v1.2.3"'
|
Loading…
Reference in New Issue