Skip to content

Commit 996ae54

Browse files
ryenusljharb
authored andcommitted
bypass aliased curl
Meanwhile keeping nvm_curl_version and nvm_curl_libz_support as-is to avoid breaking tests which redefines `curl` as a shell function.
1 parent b77fcec commit 996ae54

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

install.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ nvm_node_version() {
106106

107107
nvm_download() {
108108
if nvm_has "curl"; then
109-
curl --fail --compressed -q "$@"
109+
command curl --fail --compressed -q "$@"
110110
elif nvm_has "wget"; then
111111
# Emulate curl with wget
112112
ARGS=$(nvm_echo "$@" | command sed -e 's/--progress-bar /--progress=bar /' \

nvm.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ nvm_get_latest() {
101101
if nvm_curl_use_compression; then
102102
CURL_COMPRESSED_FLAG="--compressed"
103103
fi
104-
NVM_LATEST_URL="$(curl ${CURL_COMPRESSED_FLAG:-} -q -w "%{url_effective}\\n" -L -s -S https://latest.nvm.sh -o /dev/null)"
104+
NVM_LATEST_URL="$(command curl ${CURL_COMPRESSED_FLAG:-} -q -w "%{url_effective}\\n" -L -s -S https://latest.nvm.sh -o /dev/null)"
105105
elif nvm_has "wget"; then
106106
NVM_LATEST_URL="$(wget -q https://latest.nvm.sh --server-response -O /dev/null 2>&1 | command awk '/^ Location: /{DEST=$2} END{ print DEST }')"
107107
else
@@ -133,7 +133,7 @@ nvm_download() {
133133
for arg in "$@"; do
134134
NVM_DOWNLOAD_ARGS="${NVM_DOWNLOAD_ARGS} \"$arg\""
135135
done
136-
eval "curl -q --fail ${CURL_COMPRESSED_FLAG:-} ${CURL_HEADER_FLAG:-} ${NVM_DOWNLOAD_ARGS}"
136+
eval "command curl -q --fail ${CURL_COMPRESSED_FLAG:-} ${CURL_HEADER_FLAG:-} ${NVM_DOWNLOAD_ARGS}"
137137
elif nvm_has "wget"; then
138138
# Emulate curl with wget
139139
ARGS=$(nvm_echo "$@" | command sed -e 's/--progress-bar /--progress=bar /' \

0 commit comments

Comments
 (0)