2014-05-05 03:03:26 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
2016-07-07 15:00:59 +08:00
|
|
|
set -ex
|
|
|
|
|
2016-11-07 03:34:36 +08:00
|
|
|
die () { echo "$@" ; exit 1; }
|
2014-05-05 03:03:26 +08:00
|
|
|
|
2022-12-28 05:16:10 +08:00
|
|
|
export NVM_DIR="$(cd ../.. && pwd)"
|
|
|
|
|
2016-11-04 13:15:18 +08:00
|
|
|
\. ../../nvm.sh
|
2014-05-05 03:03:26 +08:00
|
|
|
|
2016-07-07 15:00:59 +08:00
|
|
|
set +ex # needed for stderr
|
|
|
|
OUTPUT="$(nvm install invalid.invalid 2>&1)"
|
|
|
|
set -ex
|
|
|
|
EXPECTED_OUTPUT="Version 'invalid.invalid' not found - try \`nvm ls-remote\` to browse available versions."
|
|
|
|
[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die "nvm installing an invalid version did not print a nice error message"
|