nvm/test/slow/nvm install/install already installed u...

25 lines
690 B
Plaintext
Raw Normal View History

#!/bin/sh
die () { echo $@ ; exit 1; }
. ../../../nvm.sh
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"
# Remove the stuff we're clobbering.
[ -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
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"