2015-01-26 04:00:52 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
2016-11-07 03:34:36 +08:00
|
|
|
die () { echo "$@" ; exit 1; }
|
2015-01-26 04:00:52 +08:00
|
|
|
|
2016-11-04 13:15:18 +08:00
|
|
|
\. ../../nvm.sh
|
2015-01-26 04:00:52 +08:00
|
|
|
|
2016-08-15 10:43:47 +08:00
|
|
|
set -ex
|
|
|
|
|
|
|
|
NVM_TEST_VERSION='v3.3.0'
|
|
|
|
NVM_PREFIXED_TEST_VERSION="iojs-${NVM_TEST_VERSION}"
|
2015-01-26 04:00:52 +08:00
|
|
|
|
|
|
|
# Remove the stuff we're clobbering.
|
2016-08-15 10:43:47 +08:00
|
|
|
nvm uninstall "${NVM_TEST_VERSION}" || echo 'not installed'
|
2015-01-26 04:00:52 +08:00
|
|
|
|
|
|
|
# Install from binary
|
2016-08-15 10:43:47 +08:00
|
|
|
echo "${NVM_PREFIXED_TEST_VERSION}" > .nvmrc
|
2015-01-26 04:00:52 +08:00
|
|
|
|
|
|
|
nvm install -s || "'nvm install -s' failed"
|
|
|
|
|
|
|
|
# Check
|
2016-08-15 10:43:47 +08:00
|
|
|
nvm_is_version_installed "${NVM_PREFIXED_TEST_VERSION}" || die 'version is not installed'
|
|
|
|
nvm run "${NVM_PREFIXED_TEST_VERSION}" --version | grep "${NVM_TEST_VERSION}" \
|
|
|
|
|| die "'nvm run ${NVM_PREFIXED_TEST_VERSION} --version | grep ${NVM_TEST_VERSION}' failed"
|