2014-05-06 13:46:46 +08:00
#!/bin/sh
2016-11-07 03:34:36 +08:00
die () { echo "$@" ; exit 1; }
2014-05-06 13:46:46 +08:00
2016-11-04 13:15:18 +08:00
\. ../../nvm.sh
2014-05-06 13:46:46 +08:00
2014-06-17 06:48:57 +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"
2014-05-06 13:46:46 +08:00
# Remove the stuff we're clobbering.
2016-06-27 06:52:26 +08:00
[ -e "${NVM_DIR}/v0.9.7" ] && rm -R "${NVM_DIR}/v0.9.7"
[ -e "${NVM_DIR}/v0.9.12" ] && rm -R "${NVM_DIR}/v0.9.12"
2014-05-06 13:46:46 +08:00
# Install from binary
nvm install 0.9.7
nvm install 0.9.12
nvm use 0.9.7
node --version | grep v0.9.7 || die "precondition failed: node doesn't start at 0.9.7"
nvm install 0.9.12
node --version | grep v0.9.12 || die "nvm install on already installed version doesn't use it"