mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-05-11 06:41:50 +00:00

uname on SmartOS cannot be used to guess if 32 and/or 64 bits binaries are supported, and its output is different than other uname commands on other operating systems. This change uses pkg_info to determine what types of binaries pkgsrc would install. If pkg_info fails to run or is not present, this change falls back to using isainfo -n, which determines what the kernel supports. It allows users to install node binaries on Solaris derivatives. io.js can also be installed on Solaris derivatives starting with version v3.3.1.
33 lines
960 B
Bash
Executable File
33 lines
960 B
Bash
Executable File
#!/bin/sh
|
|
|
|
die () { echo $@ ; exit 1; }
|
|
|
|
. ../../../nvm.sh
|
|
. ../../common.sh
|
|
|
|
# Invalid version numbers fail
|
|
assert_not_ok nvm_has_solaris_binary ""
|
|
assert_not_ok nvm_has_solaris_binary "foo"
|
|
|
|
# "Invalid" node version numbers fail
|
|
assert_not_ok nvm_has_solaris_binary "v1.0.0"
|
|
assert_not_ok nvm_has_solaris_binary "v3.3.1"
|
|
|
|
# Valid io.js version numbers that have a Solaris binary succeed
|
|
assert_ok nvm_has_solaris_binary "iojs-v3.3.1"
|
|
|
|
# Invvalid io.js version numbers fail
|
|
assert_not_ok nvm_has_solaris_binary "iojs-v0.12.7"
|
|
|
|
# Valid node version numbers that don't have a Solaris binary fail
|
|
assert_not_ok nvm_has_solaris_binary "v0.8.5"
|
|
|
|
# Valid node version numbers that have a Solaris binary succeed
|
|
assert_ok nvm_has_solaris_binary "v0.8.6"
|
|
assert_ok nvm_has_solaris_binary "v0.10.0"
|
|
assert_ok nvm_has_solaris_binary "v0.12.7"
|
|
|
|
# Valid "merged" version numbers succeed
|
|
assert_ok nvm_has_solaris_binary "v4.0.0"
|
|
assert_ok nvm_has_solaris_binary "v4.1.1"
|