2015-01-14 09:52:18 +08:00
#!/bin/sh
2016-11-07 03:34:36 +08:00
die () { echo "$@" ; exit 1; }
2015-01-14 09:52:18 +08:00
2016-11-04 13:15:18 +08:00
\. ../../nvm.sh
2015-01-14 09:52:18 +08:00
[ "$(nvm install invalid.invalid 2>&1)" = "Version 'invalid.invalid' not found - try \`nvm ls-remote\` to browse available versions." ] || die "nvm installing an invalid version did not print a nice error message"
# Remove the stuff we're clobbering.
2016-06-27 06:52:26 +08:00
[ -e "${NVM_DIR}/versions/io.js/v1.0.0" ] && rm -R "${NVM_DIR}/versions/io.js/v1.0.0"
[ -e "${NVM_DIR}/versions/io.js/v1.0.1" ] && rm -R "${NVM_DIR}/versions/io.js/v1.0.1"
2015-01-14 09:52:18 +08:00
# Install from binary
nvm install iojs-v1.0.0
nvm install iojs-v1.0.1
nvm use iojs-v1.0.0
node --version | grep v1.0.0 || die "precondition failed: iojs node doesn't start at v1.0.0"
iojs --version | grep v1.0.0 || die "precondition failed: iojs binary doesn't start at v1.0.0"
nvm install iojs-v1.0.1
node --version | grep v1.0.1 || die "nvm install on already installed version doesn't use it (node binary)"
iojs --version | grep v1.0.1 || die "nvm install on already installed version doesn't use it (iojs binary)"