From f451b7c4ced58bbb1baefd11dcd1ad4c0d78ba0d Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Thu, 1 Aug 2024 10:35:37 -0700 Subject: [PATCH] [Fix] `nvm install -b`: do not attempt to download source on a failed binary download with `-b` Fixes 3399 --- nvm.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nvm.sh b/nvm.sh index 82d26c00ed..8ef7f851ec 100755 --- a/nvm.sh +++ b/nvm.sh @@ -2437,7 +2437,7 @@ nvm_download_artifact() { nvm_err "Downloading ${TARBALL_URL}..." nvm_download -L -C - "${PROGRESS_BAR}" "${TARBALL_URL}" -o "${TARBALL}" || ( command rm -rf "${TARBALL}" "${tmpdir}" - nvm_err "Binary download from ${TARBALL_URL} failed, trying source." + nvm_err "download from ${TARBALL_URL} failed" return 4 ) @@ -3560,7 +3560,7 @@ nvm() { EXIT_CODE=-1 fi - if [ $EXIT_CODE -ne 0 ]; then + if [ $EXIT_CODE -ne 0 ] && [ $nosource -ne 1 ]; then if [ -z "${NVM_MAKE_JOBS-}" ]; then nvm_get_make_jobs fi