2014-09-22 02:14:18 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
2016-11-07 03:34:36 +08:00
|
|
|
die () { echo "$@" ; exit 1; }
|
2014-09-22 02:14:18 +08:00
|
|
|
|
2016-11-04 13:15:18 +08:00
|
|
|
\. ../../nvm.sh
|
2014-09-22 02:14:18 +08:00
|
|
|
|
|
|
|
# Remove the stuff we're clobbering.
|
2016-06-27 06:52:26 +08:00
|
|
|
[ -e "${NVM_DIR}/v0.9.7" ] && rm -R "${NVM_DIR}/v0.9.7"
|
|
|
|
[ -e "${NVM_DIR}/v0.9.12" ] && rm -R "${NVM_DIR}/v0.9.12"
|
2014-09-22 02:14:18 +08:00
|
|
|
|
|
|
|
# Install from binary
|
|
|
|
nvm install 0.9.7
|
|
|
|
|
|
|
|
# Check
|
2016-06-27 06:52:26 +08:00
|
|
|
[ -d "${NVM_DIR}/v0.9.7" ] || die "nvm install 0.9.7 didn't install"
|
2014-09-22 02:14:18 +08:00
|
|
|
|
|
|
|
nvm use 0.9.7
|
|
|
|
|
|
|
|
node --version | grep v0.9.7 > /dev/null || die "nvm use 0.9.7 failed"
|
|
|
|
|
2015-06-29 15:04:59 +08:00
|
|
|
npm install -g object-is@0.0.0 || die "npm install -g object-is failed"
|
|
|
|
npm list --global | grep object-is > /dev/null || die "object-is isn't installed"
|
2014-09-22 02:14:18 +08:00
|
|
|
|
|
|
|
nvm ls 0.9 | grep v0.9.7 > /dev/null || die "nvm ls 0.9 didn't show v0.9.7"
|
|
|
|
|
2014-11-23 02:52:44 +08:00
|
|
|
nvm install 0.9.12 --reinstall-packages-from=0.9 || die "nvm install 0.9.12 --reinstall-packages-from=0.9 failed"
|
2014-09-22 02:14:18 +08:00
|
|
|
|
2016-06-27 06:52:26 +08:00
|
|
|
[ -d "${NVM_DIR}/v0.9.12" ] || die "nvm install 0.9.12 didn't install"
|
2014-09-22 02:14:18 +08:00
|
|
|
|
|
|
|
nvm use 0.9
|
|
|
|
node --version | grep v0.9.12 > /dev/null || die "nvm ls 0.9 didn't use v0.9.12"
|
|
|
|
|
2015-06-29 15:04:59 +08:00
|
|
|
npm list --global | grep object-is > /dev/null || die "object-is isn't installed"
|