Compare commits

...

2 Commits

Author SHA1 Message Date
Jordan Harband
c80b89720f
fixup 2024-08-20 22:47:56 -07:00
Jordan Harband
4792d122b1
[Fix] nvm_download: ensure all args are quoted 2024-08-20 22:33:38 -07:00
2 changed files with 8 additions and 1 deletions

7
nvm.sh
View File

@ -128,7 +128,12 @@ nvm_download() {
if nvm_curl_use_compression; then if nvm_curl_use_compression; then
CURL_COMPRESSED_FLAG="--compressed" CURL_COMPRESSED_FLAG="--compressed"
fi fi
eval "curl -q --fail ${CURL_COMPRESSED_FLAG:-} ${CURL_HEADER_FLAG:-} $*" local NVM_DOWNLOAD_ARGS
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,4 +15,6 @@ 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