Skip to content
Myr

[Fix] `nvm install -b`: do not attempt to download source on a failed binary download with `-b`

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Fixes #3399

authored by Jordan Harband · committed by Jordan Harband · parent 271720e · Browse files · 2 files+6 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+6 added−2 removed

  • tests:+4 added−0 removed
  • other:+2 added−2 removed

2 files+6 added−2 removed

modified:test/fast/Unit tests/nvm install -b+4 added
2 unmodified lines
3die () { echo "$@" ; exit 1; }45\. ../../../nvm.sh67nvm_install_source() {8 exit 429}1011VERSION="0.7.0"1213EXIT_CODE=$(nvm install -b "${VERSION}" ; echo $?)14
6 unmodified lines
modified:nvm.sh+2 added-2 removed
2435 unmodified lines
2436 fi2437 nvm_err "Downloading ${TARBALL_URL}..."2438 nvm_download -L -C - "${PROGRESS_BAR}" "${TARBALL_URL}" -o "${TARBALL}" || (2439 command rm -rf "${TARBALL}" "${tmpdir}"2440 nvm_err "Binary download from ${TARBALL_URL} failed, trying source."2440 nvm_err "download from ${TARBALL_URL} failed"2441 return 42442 )24432444 if nvm_grep '404 Not Found' "${TARBALL}" >/dev/null; then
1118 unmodified lines
3563 EXIT_CODE=33564 fi3565 fi35663567 if [ $EXIT_CODE -ne 0 ]; then3567 if [ $EXIT_CODE -ne 0 ] && [ $nosource -ne 1 ]; then3568 if [ -z "${NVM_MAKE_JOBS-}" ]; then3569 nvm_get_make_jobs3570 fi3571
1009 unmodified lines