nvm/test/installation/install while reinstalling ...

35 lines
951 B
Plaintext
Raw Normal View History

#!/bin/sh
die () { echo $@ ; exit 1; }
. ../../nvm.sh
# 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
# Check
[ -d ../../v0.9.7 ] || die "nvm install 0.9.7 didn't install"
nvm use 0.9.7
node --version | grep v0.9.7 > /dev/null || die "nvm use 0.9.7 failed"
npm install -g is-nan@1.0.1 || die "npm install -g is-nan failed"
npm list --global | grep is-nan > /dev/null || die "is-nan isn't installed"
nvm ls 0.9 | grep v0.9.7 > /dev/null || die "nvm ls 0.9 didn't show v0.9.7"
nvm install 0.9.12 --reinstall-packages-from=0.9 || die "nvm install 0.9.12 --reinstall-packages-from=0.9 failed"
[ -d ../../v0.9.12 ] || die "nvm install 0.9.12 didn't install"
nvm use 0.9
node --version | grep v0.9.12 > /dev/null || die "nvm ls 0.9 didn't use v0.9.12"
npm list --global | grep is-nan > /dev/null || die "is-nan isn't installed"