2015-01-22 02:48:20 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
2016-11-07 03:34:36 +08:00
|
|
|
die () { echo "$@" ; exit 1; }
|
2015-01-22 02:48:20 +08:00
|
|
|
|
2016-11-04 13:15:18 +08:00
|
|
|
\. ../../nvm.sh
|
2015-01-22 02:48:20 +08:00
|
|
|
|
|
|
|
NVM_VERSION="v1"
|
2016-07-07 06:31:25 +08:00
|
|
|
NVM_PREFIXED_TEST_VERSION="$(nvm ls-remote "$NVM_VERSION" | tail -1 | sed 's/^[ ]*//;s/[ ]*$//')"
|
2015-01-22 02:48:20 +08:00
|
|
|
NVM_TEST_VERSION="$(nvm_strip_iojs_prefix "$NVM_PREFIXED_TEST_VERSION")"
|
|
|
|
|
|
|
|
# Remove the stuff we're clobbering.
|
2016-05-09 13:21:33 +08:00
|
|
|
[ -e ../../$NVM_TEST_VERSION ] && rm -R ../../$NVM_TEST_VERSION
|
2015-01-22 02:48:20 +08:00
|
|
|
|
|
|
|
# Install from binary
|
|
|
|
nvm install "$NVM_VERSION" || die "nvm install $NVM_VERSION failed"
|
|
|
|
|
|
|
|
# Check
|
2016-06-27 06:52:26 +08:00
|
|
|
[ -d "${NVM_DIR}/versions/io.js/$NVM_TEST_VERSION" ]
|
2015-01-22 02:48:20 +08:00
|
|
|
nvm run $NVM_PREFIXED_TEST_VERSION --version | grep $NVM_TEST_VERSION || die "'nvm run $NVM_PREFIXED_TEST_VERSION --version | grep $NVM_TEST_VERSION' failed"
|