2014-09-29 15:09:17 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
2016-11-04 13:15:18 +08:00
|
|
|
\. ../../../nvm.sh
|
|
|
|
\. ../../common.sh
|
2014-09-29 15:09:17 +08:00
|
|
|
|
2016-11-07 03:34:36 +08:00
|
|
|
die () { echo "$@" ; exit 1; }
|
2014-09-29 15:09:17 +08:00
|
|
|
|
2016-04-28 08:05:33 +08:00
|
|
|
NVM_ALIAS_OUTPUT=$(nvm alias | strip_colors)
|
2014-09-29 15:09:17 +08:00
|
|
|
|
|
|
|
EXPECTED_STABLE="$(nvm_print_implicit_alias local stable)"
|
|
|
|
STABLE_VERSION="$(nvm_version "$EXPECTED_STABLE")"
|
2016-04-28 08:05:33 +08:00
|
|
|
echo "$NVM_ALIAS_OUTPUT" | \grep -F "stable -> $EXPECTED_STABLE (-> $STABLE_VERSION) (default)" \
|
|
|
|
|| die "nvm alias did not contain the default local stable node version; got '$NVM_ALIAS_OUTPUT'"
|
2014-09-29 15:09:17 +08:00
|
|
|
|
2016-04-28 08:05:33 +08:00
|
|
|
echo "$NVM_ALIAS_OUTPUT" | \grep -F "node -> stable (-> $STABLE_VERSION) (default)" \
|
|
|
|
|| die "nvm alias did not contain the default local stable node version under 'node'; got '$NVM_ALIAS_OUTPUT'"
|
2015-02-11 06:41:45 +08:00
|
|
|
|
2014-09-29 15:09:17 +08:00
|
|
|
EXPECTED_UNSTABLE="$(nvm_print_implicit_alias local unstable)"
|
|
|
|
UNSTABLE_VERSION="$(nvm_version "$EXPECTED_UNSTABLE")"
|
2016-04-28 08:05:33 +08:00
|
|
|
echo "$NVM_ALIAS_OUTPUT" | \grep -F "unstable -> $EXPECTED_UNSTABLE (-> $UNSTABLE_VERSION) (default)" \
|
|
|
|
|| die "nvm alias did not contain the default local unstable node version; got '$NVM_ALIAS_OUTPUT'"
|
2014-09-29 15:09:17 +08:00
|
|
|
|
2015-02-11 06:41:45 +08:00
|
|
|
EXPECTED_IOJS="$(nvm_print_implicit_alias local iojs)"
|
|
|
|
IOJS_VERSION="$(nvm_version "$EXPECTED_IOJS")"
|
2016-04-28 08:05:33 +08:00
|
|
|
echo "$NVM_ALIAS_OUTPUT" | \grep -F "iojs -> $EXPECTED_IOJS (-> $IOJS_VERSION) (default)" \
|
|
|
|
|| die "nvm alias did not contain the default local iojs version; got '$NVM_ALIAS_OUTPUT'"
|
2015-02-11 06:41:45 +08:00
|
|
|
|