2013-01-12 12:30:12 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
2014-10-03 17:35:39 +08:00
|
|
|
die () { echo $@ ; exit 1; }
|
|
|
|
|
2015-01-18 01:26:52 +08:00
|
|
|
. ../../../nvm.sh
|
2013-01-12 12:30:12 +08:00
|
|
|
|
2016-02-04 16:26:33 +08:00
|
|
|
nvm unalias default || die 'unable to unalias default'
|
|
|
|
|
2014-04-20 07:48:14 +08:00
|
|
|
NVM_TEST_VERSION=v0.10.7
|
2014-02-22 10:15:40 +08:00
|
|
|
|
2013-01-12 12:30:12 +08:00
|
|
|
# Remove the stuff we're clobbering.
|
2015-01-18 01:26:52 +08:00
|
|
|
[ -e ../../../$NVM_TEST_VERSION ] && rm -R ../../../$NVM_TEST_VERSION
|
2013-01-12 12:30:12 +08:00
|
|
|
|
|
|
|
# Install from binary
|
2014-10-03 17:35:39 +08:00
|
|
|
nvm install $NVM_TEST_VERSION || die "install $NVM_TEST_VERSION failed"
|
2013-01-12 12:30:12 +08:00
|
|
|
|
|
|
|
# Check
|
2015-01-18 01:26:52 +08:00
|
|
|
[ -d ../../../$NVM_TEST_VERSION ]
|
2014-10-03 17:35:39 +08:00
|
|
|
nvm run $NVM_TEST_VERSION --version | grep $NVM_TEST_VERSION || die "'nvm run $NVM_TEST_VERSION --version | grep $NVM_TEST_VERSION' failed"
|
2014-04-20 07:48:14 +08:00
|
|
|
|
2016-02-04 16:26:33 +08:00
|
|
|
# ensure default is set
|
|
|
|
NVM_CURRENT_DEFAULT="$(nvm_alias default)"
|
|
|
|
[ "$NVM_CURRENT_DEFAULT" = "$NVM_TEST_VERSION" ] || die "wrong default alias: $(nvm alias)"
|