2012-10-11 07:17:09 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
2013-05-04 00:46:21 +08:00
|
|
|
mkdir -p ../../v0.2.3
|
|
|
|
|
|
|
|
die () { echo $@ ; exit 1; }
|
|
|
|
|
2014-02-21 18:59:50 +08:00
|
|
|
[ `expr $PATH : ".*v0.2.3/.*/bin"` = 0 ] || echo "WARNING: Unexpectedly found v0.2.3 already active" >&2
|
2013-05-04 00:46:21 +08:00
|
|
|
|
2012-10-11 07:17:09 +08:00
|
|
|
. ../../nvm.sh
|
2013-05-04 00:46:21 +08:00
|
|
|
nvm use v0.2.3 &&
|
2014-11-30 00:52:09 +08:00
|
|
|
[ `expr $PATH : ".*v0.2.3/.*/bin"` != 0 ] && [ `expr $NODE_PATH : ".*v0.2.3/.*/lib/node_modules"` = 0 ] || die "Failed to activate v0.2.3"
|
|
|
|
# ^ note: NODE_PATH should not contain `npm root -g` since globals should not be requireable
|
2013-05-04 00:46:21 +08:00
|
|
|
|
2012-10-11 07:17:09 +08:00
|
|
|
nvm deactivate &&
|
2014-05-06 03:43:22 +08:00
|
|
|
[ `expr $PATH : ".*v0.2.3/.*/bin"` = 0 ] && [ `expr $NODE_PATH : ".*v0.2.3/.*/lib/node_modules"` = 0 ] || die "Failed to deactivate v0.2.3"
|