2014-02-26 15:43:12 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
2014-10-03 17:35:39 +08:00
|
|
|
die () { echo $@ ; exit 1; }
|
|
|
|
|
2014-09-15 08:51:34 +08:00
|
|
|
. ../../nvm.sh
|
2014-02-26 15:43:12 +08:00
|
|
|
|
|
|
|
# Remove the stuff we're clobbering.
|
2014-09-15 08:51:34 +08:00
|
|
|
[ -e ../../v0.9.7 ] && rm -R ../../v0.9.7
|
|
|
|
[ -e ../../v0.9.12 ] && rm -R ../../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
|
2014-10-03 17:35:39 +08:00
|
|
|
[ -d ../../v0.9.7 ] || die "v0.9.7 didn't exist"
|
|
|
|
[ -d ../../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)"
|
2014-04-20 07:31:48 +08:00
|
|
|
|