[Refactor] Rename solaris and iojs helper functions to be nvm_ prefixed
Renames node_version_has_solaris_binary and nvm_iojs_version_has_solaris_binary to be prefixed with nvm_ so they do not show up in tab completion following the word "node".
parent
7aba64a2d5
commit
91a55dd91a
10
nvm.sh
10
nvm.sh
|
@ -2250,7 +2250,7 @@ nvm_die_on_prefix() {
|
||||||
# Currently, only io.js 3.3.1 has a Solaris binary available, and it's the
|
# Currently, only io.js 3.3.1 has a Solaris binary available, and it's the
|
||||||
# latest io.js version available. The expectation is that any potential io.js
|
# latest io.js version available. The expectation is that any potential io.js
|
||||||
# version later than v3.3.1 will also have Solaris binaries.
|
# version later than v3.3.1 will also have Solaris binaries.
|
||||||
iojs_version_has_solaris_binary() {
|
nvm_iojs_version_has_solaris_binary() {
|
||||||
local IOJS_VERSION
|
local IOJS_VERSION
|
||||||
IOJS_VERSION="$1"
|
IOJS_VERSION="$1"
|
||||||
local STRIPPED_IOJS_VERSION
|
local STRIPPED_IOJS_VERSION
|
||||||
|
@ -2267,7 +2267,7 @@ iojs_version_has_solaris_binary() {
|
||||||
# Solaris binary, fails otherwise.
|
# Solaris binary, fails otherwise.
|
||||||
# Currently, node versions starting from v0.8.6 have a Solaris binary
|
# Currently, node versions starting from v0.8.6 have a Solaris binary
|
||||||
# available.
|
# available.
|
||||||
node_version_has_solaris_binary() {
|
nvm_node_version_has_solaris_binary() {
|
||||||
local NODE_VERSION
|
local NODE_VERSION
|
||||||
NODE_VERSION="$1"
|
NODE_VERSION="$1"
|
||||||
# Error out if $NODE_VERSION is actually an io.js version
|
# Error out if $NODE_VERSION is actually an io.js version
|
||||||
|
@ -2291,9 +2291,9 @@ nvm_has_solaris_binary() {
|
||||||
if nvm_is_merged_node_version "${VERSION}"; then
|
if nvm_is_merged_node_version "${VERSION}"; then
|
||||||
return 0 # All merged node versions have a Solaris binary
|
return 0 # All merged node versions have a Solaris binary
|
||||||
elif nvm_is_iojs_version "${VERSION}"; then
|
elif nvm_is_iojs_version "${VERSION}"; then
|
||||||
iojs_version_has_solaris_binary "${VERSION}"
|
nvm_iojs_version_has_solaris_binary "${VERSION}"
|
||||||
else
|
else
|
||||||
node_version_has_solaris_binary "${VERSION}"
|
nvm_node_version_has_solaris_binary "${VERSION}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3571,7 +3571,7 @@ nvm() {
|
||||||
nvm_list_aliases nvm_make_alias nvm_print_alias_path \
|
nvm_list_aliases nvm_make_alias nvm_print_alias_path \
|
||||||
nvm_print_default_alias nvm_print_formatted_alias nvm_resolve_local_alias \
|
nvm_print_default_alias nvm_print_formatted_alias nvm_resolve_local_alias \
|
||||||
nvm_sanitize_path nvm_has_colors nvm_process_parameters \
|
nvm_sanitize_path nvm_has_colors nvm_process_parameters \
|
||||||
node_version_has_solaris_binary iojs_version_has_solaris_binary \
|
nvm_node_version_has_solaris_binary nvm_iojs_version_has_solaris_binary \
|
||||||
nvm_curl_libz_support nvm_command_info nvm_is_zsh nvm_stdout_is_terminal \
|
nvm_curl_libz_support nvm_command_info nvm_is_zsh nvm_stdout_is_terminal \
|
||||||
>/dev/null 2>&1
|
>/dev/null 2>&1
|
||||||
unset NVM_RC_VERSION NVM_NODEJS_ORG_MIRROR NVM_IOJS_ORG_MIRROR NVM_DIR \
|
unset NVM_RC_VERSION NVM_NODEJS_ORG_MIRROR NVM_IOJS_ORG_MIRROR NVM_DIR \
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
die () { echo "$@" ; exit 1; }
|
|
||||||
|
|
||||||
\. ../../../nvm.sh
|
|
||||||
\. ../../common.sh
|
|
||||||
|
|
||||||
assert_not_ok iojs_version_has_solaris_binary ""
|
|
||||||
assert_not_ok iojs_version_has_solaris_binary "foo"
|
|
||||||
assert_not_ok iojs_version_has_solaris_binary "v1.1.0"
|
|
||||||
|
|
||||||
assert_ok iojs_version_has_solaris_binary "v3.3.1"
|
|
||||||
assert_ok iojs_version_has_solaris_binary "iojs-v3.3.1"
|
|
||||||
assert_ok iojs_version_has_solaris_binary "v3.3.2"
|
|
||||||
assert_ok iojs_version_has_solaris_binary "iojs-v3.3.2"
|
|
||||||
assert_ok iojs_version_has_solaris_binary "v3.4.1"
|
|
||||||
assert_ok iojs_version_has_solaris_binary "iojs-v3.4.1"
|
|
|
@ -1,33 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
die () { echo "$@" ; exit 1; }
|
|
||||||
|
|
||||||
\. ../../../nvm.sh
|
|
||||||
\. ../../common.sh
|
|
||||||
|
|
||||||
# Invalid version numbers fail
|
|
||||||
assert_not_ok node_version_has_solaris_binary ""
|
|
||||||
assert_not_ok node_version_has_solaris_binary "foo"
|
|
||||||
|
|
||||||
# "Invalid" node version numbers fail
|
|
||||||
assert_not_ok node_version_has_solaris_binary "v1.0.0"
|
|
||||||
assert_not_ok node_version_has_solaris_binary "v3.3.1"
|
|
||||||
|
|
||||||
# Valid io.js version numbers that have a Solaris binary fail
|
|
||||||
assert_not_ok node_version_has_solaris_binary "iojs-v3.3.1"
|
|
||||||
|
|
||||||
# Invalid io.js version numbers fail
|
|
||||||
assert_not_ok node_version_has_solaris_binary "iojs-v0.12.7"
|
|
||||||
|
|
||||||
# Valid node version numbers that don't have a Solaris binary fail
|
|
||||||
assert_not_ok node_version_has_solaris_binary "v0.8.5"
|
|
||||||
|
|
||||||
# Valid node version numbers that have a Solaris binary succeed
|
|
||||||
assert_ok node_version_has_solaris_binary "v0.8.6"
|
|
||||||
assert_ok node_version_has_solaris_binary "v0.10.0"
|
|
||||||
assert_ok node_version_has_solaris_binary "v0.12.7"
|
|
||||||
|
|
||||||
# Valid "merged" version numbers fail, because they're not
|
|
||||||
# considered node version numbers
|
|
||||||
assert_not_ok node_version_has_solaris_binary "v4.0.0"
|
|
||||||
assert_not_ok node_version_has_solaris_binary "v4.1.1"
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
die () { echo "$@" ; exit 1; }
|
||||||
|
|
||||||
|
\. ../../../nvm.sh
|
||||||
|
\. ../../common.sh
|
||||||
|
|
||||||
|
assert_not_ok nvm_iojs_version_has_solaris_binary ""
|
||||||
|
assert_not_ok nvm_iojs_version_has_solaris_binary "foo"
|
||||||
|
assert_not_ok nvm_iojs_version_has_solaris_binary "v1.1.0"
|
||||||
|
|
||||||
|
assert_ok nvm_iojs_version_has_solaris_binary "v3.3.1"
|
||||||
|
assert_ok nvm_iojs_version_has_solaris_binary "iojs-v3.3.1"
|
||||||
|
assert_ok nvm_iojs_version_has_solaris_binary "v3.3.2"
|
||||||
|
assert_ok nvm_iojs_version_has_solaris_binary "iojs-v3.3.2"
|
||||||
|
assert_ok nvm_iojs_version_has_solaris_binary "v3.4.1"
|
||||||
|
assert_ok nvm_iojs_version_has_solaris_binary "iojs-v3.4.1"
|
|
@ -0,0 +1,33 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
die () { echo "$@" ; exit 1; }
|
||||||
|
|
||||||
|
\. ../../../nvm.sh
|
||||||
|
\. ../../common.sh
|
||||||
|
|
||||||
|
# Invalid version numbers fail
|
||||||
|
assert_not_ok nvm_node_version_has_solaris_binary ""
|
||||||
|
assert_not_ok nvm_node_version_has_solaris_binary "foo"
|
||||||
|
|
||||||
|
# "Invalid" node version numbers fail
|
||||||
|
assert_not_ok nvm_node_version_has_solaris_binary "v1.0.0"
|
||||||
|
assert_not_ok nvm_node_version_has_solaris_binary "v3.3.1"
|
||||||
|
|
||||||
|
# Valid io.js version numbers that have a Solaris binary fail
|
||||||
|
assert_not_ok nvm_node_version_has_solaris_binary "iojs-v3.3.1"
|
||||||
|
|
||||||
|
# Invalid io.js version numbers fail
|
||||||
|
assert_not_ok nvm_node_version_has_solaris_binary "iojs-v0.12.7"
|
||||||
|
|
||||||
|
# Valid node version numbers that don't have a Solaris binary fail
|
||||||
|
assert_not_ok nvm_node_version_has_solaris_binary "v0.8.5"
|
||||||
|
|
||||||
|
# Valid node version numbers that have a Solaris binary succeed
|
||||||
|
assert_ok nvm_node_version_has_solaris_binary "v0.8.6"
|
||||||
|
assert_ok nvm_node_version_has_solaris_binary "v0.10.0"
|
||||||
|
assert_ok nvm_node_version_has_solaris_binary "v0.12.7"
|
||||||
|
|
||||||
|
# Valid "merged" version numbers fail, because they're not
|
||||||
|
# considered node version numbers
|
||||||
|
assert_not_ok nvm_node_version_has_solaris_binary "v4.0.0"
|
||||||
|
assert_not_ok nvm_node_version_has_solaris_binary "v4.1.1"
|
Loading…
Reference in New Issue