2014-02-26 15:43:12 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
2016-11-07 03:34:36 +08:00
|
|
|
die () { echo "$@" ; exit 1; }
|
2014-10-03 17:35:39 +08:00
|
|
|
|
2016-11-04 13:15:18 +08:00
|
|
|
\. ../../nvm.sh
|
2014-02-26 15:43:12 +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-02-26 15:43:12 +08:00
|
|
|
|
|
|
|
# Install from binary
|
2014-10-03 17:35:39 +08:00
|
|
|
nvm install 0.9.7 || die "'nvm install 0.9.7' failed"
|
|
|
|
nvm i 0.9.12 || die "'nvm i 0.9.12' failed"
|
2014-02-26 15:43:12 +08:00
|
|
|
|
|
|
|
# Check
|
2016-06-27 06:52:26 +08:00
|
|
|
[ -d "${NVM_DIR}/v0.9.7" ] || die "v0.9.7 didn't exist"
|
|
|
|
[ -d "${NVM_DIR}/v0.9.12" ] || die "v0.9.12 didn't exist"
|
2014-02-26 15:43:12 +08:00
|
|
|
|
|
|
|
# Use the first one
|
2014-10-03 17:35:39 +08:00
|
|
|
nvm use 0.9.7 || die "'nvm use 0.9.7' failed"
|
2014-02-26 15:43:12 +08:00
|
|
|
|
|
|
|
# Use the latest one
|
2014-10-03 17:35:39 +08:00
|
|
|
nvm use 0.9 || die "'nvm use 0.9' failed"
|
|
|
|
node --version | grep v0.9.12 || die "'node --version' was not v0.9.12, got: $(node --version)"
|