Compare commits

..

2 Commits

Author SHA1 Message Date
Jordan Harband
554e89d5ef
[Fix] --save: avoid a conflict with set -e 2024-08-10 15:52:24 +12:00
Jordan Harband
6f774ad18c
[Refactor] --save: clean up some usage 2024-08-20 16:21:45 -07:00
2 changed files with 1 additions and 8 deletions

7
nvm.sh
View File

@ -128,12 +128,7 @@ nvm_download() {
if nvm_curl_use_compression; then if nvm_curl_use_compression; then
CURL_COMPRESSED_FLAG="--compressed" CURL_COMPRESSED_FLAG="--compressed"
fi fi
local NVM_DOWNLOAD_ARGS eval "curl -q --fail ${CURL_COMPRESSED_FLAG:-} ${CURL_HEADER_FLAG:-} $*"
NVM_DOWNLOAD_ARGS=''
for arg in "$@"; do
NVM_DOWNLOAD_ARGS="${NVM_DOWNLOAD_ARGS} \"$arg\""
done
eval "curl -q --fail ${CURL_COMPRESSED_FLAG:-} ${CURL_HEADER_FLAG:-} ${NVM_DOWNLOAD_ARGS}"
elif nvm_has "wget"; then elif nvm_has "wget"; then
# Emulate curl with wget # Emulate curl with wget
ARGS=$(nvm_echo "$@" | command sed -e 's/--progress-bar /--progress=bar /' \ ARGS=$(nvm_echo "$@" | command sed -e 's/--progress-bar /--progress=bar /' \

View File

@ -15,6 +15,4 @@ if nvm_download "https://raw.githubusercontent.com/nvm-sh/nvm/HEAD/wrong_install
die "nvm_download should fail to download no existing file" die "nvm_download should fail to download no existing file"
fi fi
nvm_download "https://raw.githubusercontent.com/nvm-sh/nvm/HEAD/install.sh" -o "; die quoted-command-not-quoted"
cleanup cleanup