2016-07-03 23:37:03 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -ex
|
|
|
|
|
|
|
|
die () { echo $@ ; exit 1; }
|
|
|
|
|
2016-11-04 13:15:18 +08:00
|
|
|
\. ../../../nvm.sh
|
2016-07-03 23:37:03 +08:00
|
|
|
|
|
|
|
nvm deactivate 2>&1 >/dev/null || die 'deactivate failed'
|
|
|
|
|
|
|
|
nvm use --lts=testing || die 'nvm use --lts=testing failed'
|
|
|
|
OUTPUT="$(nvm current)"
|
|
|
|
EXPECTED_OUTPUT="$(nvm_resolve_alias 'lts/testing')"
|
|
|
|
|
|
|
|
[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] \
|
|
|
|
|| die "'nvm use --lts=testing' + 'nvm current' did not output '$EXPECTED_OUTPUT'; got '$OUTPUT'"
|
|
|
|
|
|
|
|
OUTPUT="$(nvm use --silent --lts=testing)"
|
|
|
|
EXPECTED_OUTPUT=""
|
|
|
|
|
|
|
|
[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] \
|
|
|
|
|| die "'nvm use --silent --lts=testing' output was not silenced '$EXPECTED_OUTPUT'; got '$OUTPUT'"
|