[Fix] `install`: Add missing io.js installation message

Fixes #1988
Peter Dave Hello 2019-01-22 15:46:29 +08:00 committed by Jordan Harband
parent 7e715d5c73
commit cc0750eb5d
No known key found for this signature in database
GPG Key ID: 64A196AEE0916D55
2 changed files with 7 additions and 1 deletions

2
nvm.sh
View File

@ -1721,6 +1721,8 @@ nvm_install_binary() {
local NODE_OR_IOJS
if [ "${FLAVOR}" = 'node' ]; then
NODE_OR_IOJS="${FLAVOR}"
elif [ "${FLAVOR}" = 'iojs' ]; then
NODE_OR_IOJS="io.js"
fi
if [ "${NVM_NO_PROGRESS-}" = "1" ]; then
# --silent, --show-error, use short option as @samrocketman mentions the compatibility issue.

View File

@ -9,9 +9,13 @@ NVM_PREFIXED_TEST_VERSION="iojs-$NVM_TEST_VERSION"
# Remove the stuff we're clobbering.
[ -e "${NVM_DIR}/versions/io.js/${NVM_TEST_VERSION}" ] && rm -R "${NVM_DIR}/versions/io.js/${NVM_TEST_VERSION}"
[ -e "${NVM_DIR}/.cache/bin/${NVM_TEST_VERSION}-linux-x64/" ] && rm -R "${NVM_DIR}/.cache/bin/${NVM_TEST_VERSION}-linux-x64/"
# Install from binary
nvm install $NVM_PREFIXED_TEST_VERSION || die "install $NVM_PREFIXED_TEST_VERSION failed"
OUTPUT_HEAD="$(2>&1 nvm install --no-progress $NVM_PREFIXED_TEST_VERSION | tac | tail -n 1)" || die "install $NVM_PREFIXED_TEST_VERSION failed"
EXPECTED_OUTPUT_HEAD="Downloading and installing io.js v1.0.0..."
[ "${OUTPUT_HEAD}" = "${EXPECTED_OUTPUT_HEAD}" ] || die "expected >${EXPECTED_OUTPUT_HEAD}<; got >${OUTPUT_HEAD}<"
# Check
[ -d "${NVM_DIR}/versions/io.js/${NVM_TEST_VERSION}" ]