nvm/test/installation/install two versions and us...

26 lines
638 B
Plaintext
Raw Normal View History

#!/bin/sh
die () { echo $@ ; exit 1; }
2014-09-15 08:51:34 +08:00
. ../../nvm.sh
# 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
# Install from binary
nvm install 0.9.7 || die "'nvm install 0.9.7' failed"
nvm i 0.9.12 || die "'nvm i 0.9.12' failed"
# Check
[ -d ../../v0.9.7 ] || die "v0.9.7 didn't exist"
[ -d ../../v0.9.12 ] || die "v0.9.12 didn't exist"
# Use the first one
nvm use 0.9.7 || die "'nvm use 0.9.7' failed"
# Use the latest one
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)"