Add `nvm_is_iojs_version`
parent
c46748a379
commit
98e0655198
5
nvm.sh
5
nvm.sh
|
@ -354,6 +354,10 @@ nvm_node_prefix() {
|
||||||
echo "node"
|
echo "node"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nvm_is_iojs_version() {
|
||||||
|
[ "_$(echo "$1" | cut -c1-5)" = "_iojs-" ]
|
||||||
|
}
|
||||||
|
|
||||||
nvm_ls() {
|
nvm_ls() {
|
||||||
local PATTERN
|
local PATTERN
|
||||||
PATTERN="$1"
|
PATTERN="$1"
|
||||||
|
@ -1198,6 +1202,7 @@ nvm() {
|
||||||
"unload" )
|
"unload" )
|
||||||
unset -f nvm nvm_print_versions nvm_checksum \
|
unset -f nvm nvm_print_versions nvm_checksum \
|
||||||
nvm_iojs_prefix nvm_node_prefix \
|
nvm_iojs_prefix nvm_node_prefix \
|
||||||
|
nvm_is_iojs_version \
|
||||||
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 \
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
die () { echo $@ ; exit 1; }
|
||||||
|
|
||||||
|
. ../../../nvm.sh
|
||||||
|
|
||||||
|
nvm_is_iojs_version 'iojs-' || die '"nvm_is_iojs_version iojs- was not true'
|
||||||
|
nvm_is_iojs_version 'iojs-foo' || die '"nvm_is_iojs_version iojs- was not true'
|
||||||
|
! nvm_is_iojs_version 'iojs' || die '"nvm_is_iojs_version iojs was not false'
|
||||||
|
! nvm_is_iojs_version 'v1.0.0' || die '"nvm_is_iojs_version v1.0.0" was not false'
|
Loading…
Reference in New Issue