File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -128,7 +128,12 @@ nvm_download() {
128
128
if nvm_curl_use_compression; then
129
129
CURL_COMPRESSED_FLAG=" --compressed"
130
130
fi
131
- eval " curl -q --fail ${CURL_COMPRESSED_FLAG:- } ${CURL_HEADER_FLAG:- } $* "
131
+ local NVM_DOWNLOAD_ARGS
132
+ NVM_DOWNLOAD_ARGS=' '
133
+ for arg in " $@ " ; do
134
+ NVM_DOWNLOAD_ARGS=" ${NVM_DOWNLOAD_ARGS} \" $arg \" "
135
+ done
136
+ eval " curl -q --fail ${CURL_COMPRESSED_FLAG:- } ${CURL_HEADER_FLAG:- } ${NVM_DOWNLOAD_ARGS} "
132
137
elif nvm_has " wget" ; then
133
138
# Emulate curl with wget
134
139
ARGS=$( nvm_echo " $@ " | command sed -e ' s/--progress-bar /--progress=bar /' \
Original file line number Diff line number Diff line change @@ -25,4 +25,7 @@ NVM_AUTH_HEADER="Bearer test-token" nvm_download "http://127.0.0.1/bearer" > /de
25
25
nvm_download " http://127.0.0.1/bearer" > /dev/null && die ' nvm_download with no auth header should not send the header and should fail'
26
26
docker stop httpbin && docker rm httpbin
27
27
28
+ # ensure quoted extra args remain quoted
29
+ nvm_download " https://raw.githubusercontent.com/nvm-sh/nvm/HEAD/install.sh" -o " ; die quoted-command-not-quoted" || die ' command failed'
30
+
28
31
cleanup
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ nvm_download "https://raw.githubusercontent.com/nvm-sh/nvm/HEAD/install.sh" >/de
12
12
13
13
# nvm_download should fail to download wrong_install.sh
14
14
if nvm_download " https://raw.githubusercontent.com/nvm-sh/nvm/HEAD/wrong_install.sh" & > /dev/null; then
15
- die " nvm_download should fail to download no existing file"
15
+ die " nvm_download should fail to download nonexistent file"
16
16
fi
17
17
18
18
cleanup
You can’t perform that action at this time.
0 commit comments