2015-01-26 04:00:52 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
2016-05-26 14:48:15 +08:00
|
|
|
. ../common.sh
|
|
|
|
|
2015-01-26 04:00:52 +08:00
|
|
|
die () { echo $@ ; exit 1; }
|
|
|
|
|
|
|
|
. ../../nvm.sh
|
|
|
|
|
2016-08-15 10:43:47 +08:00
|
|
|
set -ex
|
|
|
|
|
|
|
|
NVM_TEST_VERSION='v3.3.1'
|
|
|
|
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 source
|
2016-08-15 10:43:47 +08:00
|
|
|
(watch nvm install -s "${NVM_PREFIXED_TEST_VERSION}") || die "'nvm install -s ${NVM_PREFIXED_TEST_VERSION}' failed"
|
2015-01-26 04:00:52 +08:00
|
|
|
|
|
|
|
# Check
|
2016-08-15 10:43:47 +08:00
|
|
|
nvm_is_version_installed "${NVM_PREFIXED_TEST_VERSION}" || die 'version not installed'
|
|
|
|
nvm run "${NVM_PREFIXED_TEST_VERSION}" --version | grep "${NVM_TEST_VERSION}" || "'nvm run ${NVM_PREFIXED_TEST_VERSION} --version | grep ${NVM_TEST_VERSION}' failed"
|