2015-01-19 10:45:02 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
2016-11-07 03:34:36 +08:00
|
|
|
die () { echo "$@" ; exit 1; }
|
2015-01-19 10:45:02 +08:00
|
|
|
|
2016-11-04 13:15:18 +08:00
|
|
|
\. ../../../nvm.sh
|
2015-01-19 10:45:02 +08:00
|
|
|
|
|
|
|
nvm deactivate 2>&1 >/dev/null || die 'deactivate failed'
|
|
|
|
|
|
|
|
nvm use node || die 'nvm use node failed'
|
|
|
|
OUTPUT="$(nvm current)"
|
|
|
|
EXPECTED_OUTPUT="$(nvm_version stable)"
|
|
|
|
|
|
|
|
[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] \
|
|
|
|
|| die "'nvm use node' + 'nvm current' did not output '$EXPECTED_OUTPUT'; got '$OUTPUT'"
|
2015-07-10 08:27:35 +08:00
|
|
|
|
|
|
|
OUTPUT="$(nvm use --silent node)"
|
|
|
|
EXPECTED_OUTPUT=""
|
|
|
|
|
|
|
|
[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] \
|
|
|
|
|| die "'nvm use --silent node' output was not silenced '$EXPECTED_OUTPUT'; got '$OUTPUT'"
|