2016-07-07 15:00:59 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -ex
|
2014-07-12 17:28:20 +08:00
|
|
|
|
2014-10-15 08:38:42 +08:00
|
|
|
export NVM_SYMLINK_CURRENT=true
|
2016-11-04 13:15:18 +08:00
|
|
|
\. ../../nvm.sh
|
2014-07-12 17:28:20 +08:00
|
|
|
|
2016-06-27 06:52:26 +08:00
|
|
|
rm -rf "${NVM_DIR}/v0.10.29"
|
|
|
|
mkdir "${NVM_DIR}/v0.10.29"
|
2016-07-07 15:00:59 +08:00
|
|
|
nvm use --delete-prefix 0.10.29
|
2016-06-27 06:52:26 +08:00
|
|
|
rmdir "${NVM_DIR}/v0.10.29"
|
2014-07-12 17:28:20 +08:00
|
|
|
|
2016-06-27 06:52:26 +08:00
|
|
|
if [ ! -L "${NVM_DIR}/current" ];then
|
2014-07-12 17:28:20 +08:00
|
|
|
echo "Expected 'current' symlink to be created!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2016-06-27 06:52:26 +08:00
|
|
|
oldLink="$(readlink "${NVM_DIR}/current")"
|
2014-07-12 17:28:20 +08:00
|
|
|
|
2016-06-27 06:52:26 +08:00
|
|
|
if [ "$(basename "${oldLink}")" != 'v0.10.29' ];then
|
|
|
|
echo "Expected 'current' to point to v0.10.29 but was ${oldLink}"
|
2014-07-12 17:28:20 +08:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2016-06-27 06:52:26 +08:00
|
|
|
rm -rf "${NVM_DIR}/v0.11.13"
|
|
|
|
mkdir "${NVM_DIR}/v0.11.13"
|
2016-07-07 15:00:59 +08:00
|
|
|
nvm use --delete-prefix 0.11.13
|
2016-06-27 06:52:26 +08:00
|
|
|
rmdir "${NVM_DIR}/v0.11.13"
|
2014-07-12 17:28:20 +08:00
|
|
|
|
2016-06-27 06:52:26 +08:00
|
|
|
newLink="$(readlink "${NVM_DIR}/current")"
|
2014-07-12 17:28:20 +08:00
|
|
|
|
2016-06-27 06:52:26 +08:00
|
|
|
if [ "$(basename "${newLink}")" != 'v0.11.13' ];then
|
2014-07-12 17:28:20 +08:00
|
|
|
echo "Expected 'current' to point to v0.11.13 but was $newLink"
|
|
|
|
exit 1
|
|
|
|
fi
|