2015-01-19 10:45:02 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
die () { echo $@ ; exit 1; }
|
|
|
|
|
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 iojs || die 'nvm use iojs failed'
|
|
|
|
OUTPUT="$(nvm current)"
|
|
|
|
EXPECTED_OUTPUT="iojs-v1.0.1"
|
|
|
|
|
|
|
|
[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] \
|
|
|
|
|| die "'nvm use iojs' + 'nvm current' did not output '$EXPECTED_OUTPUT'; got '$OUTPUT'"
|
2015-07-10 08:27:35 +08:00
|
|
|
|
|
|
|
OUTPUT="$(nvm use --silent iojs)"
|
|
|
|
EXPECTED_OUTPUT=""
|
|
|
|
|
|
|
|
[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] \
|
|
|
|
|| die "'nvm use --silent iojs' output was not silenced '$EXPECTED_OUTPUT'; got '$OUTPUT'"
|