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.
|
2018-08-16 06:01:47 +08:00
|
|
|
[ -e "${NVM_DIR}/versions/node/v9.7.0" ] && rm -R "${NVM_DIR}/versions/node/v9.7.0"
|
|
|
|
[ -e "${NVM_DIR}/versions/node/v9.10.0" ] && rm -R "${NVM_DIR}/versions/node/v9.10.0"
|
2020-06-05 07:15:39 +08:00
|
|
|
[ -e "${NVM_DIR}/versions/node/v4.9.1" ] && rm -R "${NVM_DIR}/versions/node/v4.9.1"
|
2014-09-22 02:14:18 +08:00
|
|
|
|
|
|
|
# Install from binary
|
2018-08-16 06:01:47 +08:00
|
|
|
nvm install 9.7.0
|
2014-09-22 02:14:18 +08:00
|
|
|
|
|
|
|
# Check
|
2018-08-16 06:01:47 +08:00
|
|
|
[ -d "${NVM_DIR}/versions/node/v9.7.0" ] || die "nvm install 9.7.0 didn't install"
|
2014-09-22 02:14:18 +08:00
|
|
|
|
2018-08-16 06:01:47 +08:00
|
|
|
nvm use 9.7.0
|
2014-09-22 02:14:18 +08:00
|
|
|
|
2018-08-16 06:01:47 +08:00
|
|
|
node --version | grep v9.7.0 > /dev/null || die "nvm use 9.7.0 failed"
|
2014-09-22 02:14:18 +08:00
|
|
|
|
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
|
|
|
|
2018-08-16 06:01:47 +08:00
|
|
|
nvm ls 9 | grep v9.7.0 > /dev/null || die "nvm ls 9 didn't show v9.7.0"
|
2014-09-22 02:14:18 +08:00
|
|
|
|
2018-08-16 06:01:47 +08:00
|
|
|
nvm install 9.10.0 --reinstall-packages-from=9 || die "nvm install 9.10.0 --reinstall-packages-from=9 failed"
|
2014-09-22 02:14:18 +08:00
|
|
|
|
2018-08-16 06:01:47 +08:00
|
|
|
[ -d "${NVM_DIR}/versions/node/v9.10.0" ] || die "nvm install 9.10.0 didn't install"
|
2014-09-22 02:14:18 +08:00
|
|
|
|
2018-08-16 06:01:47 +08:00
|
|
|
nvm use 9
|
|
|
|
node --version | grep v9.10.0 > /dev/null || die "nvm ls 9 didn't use v9.10.0"
|
2014-09-22 02:14:18 +08:00
|
|
|
|
2015-06-29 15:04:59 +08:00
|
|
|
npm list --global | grep object-is > /dev/null || die "object-is isn't installed"
|
2020-06-05 07:15:39 +08:00
|
|
|
|
|
|
|
|
|
|
|
# LTS
|
|
|
|
|
|
|
|
nvm install --lts=argon --reinstall-packages-from=9 || die "nvm install 9.10.0 --reinstall-packages-from=9 failed"
|
|
|
|
|
|
|
|
[ -d "${NVM_DIR}/versions/node/v4.9.1" ] || die "nvm install 4.9.1 didn't install"
|
|
|
|
|
|
|
|
nvm use --lts=argon
|
|
|
|
node --version | grep v4.9.1 > /dev/null || die "nvm ls --lts=argon didn't use v4.9.1"
|
|
|
|
|
|
|
|
npm list --global | grep object-is > /dev/null || die "object-is isn't installed"
|