Skip to content

Commit 847cc1d

Browse files
committed
bypass aliased curl
Meanwhile keeping nvm_curl_libz_support as-is to avoid breaking tests which requires `curl` to be a shell function.
1 parent f36516b commit 847cc1d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

install.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ nvm_node_version() {
9090

9191
nvm_download() {
9292
if nvm_has "curl"; then
93-
curl --fail --compressed -q "$@"
93+
command curl --fail --compressed -q "$@"
9494
elif nvm_has "wget"; then
9595
# Emulate curl with wget
9696
ARGS=$(nvm_echo "$@" | command sed -e 's/--progress-bar /--progress=bar /' \

nvm.sh

+3-3
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
@@ -121,7 +121,7 @@ nvm_download() {
121121
if nvm_curl_use_compression; then
122122
CURL_COMPRESSED_FLAG="--compressed"
123123
fi
124-
curl --fail ${CURL_COMPRESSED_FLAG:-} -q "$@"
124+
command curl --fail ${CURL_COMPRESSED_FLAG:-} -q "$@"
125125
elif nvm_has "wget"; then
126126
# Emulate curl with wget
127127
ARGS=$(nvm_echo "$@" | command sed -e 's/--progress-bar /--progress=bar /' \
@@ -470,7 +470,7 @@ nvm_clang_version() {
470470
}
471471

472472
nvm_curl_version() {
473-
curl -V | command awk '{ if ($1 == "curl") print $2 }' | command sed 's/-.*$//g'
473+
command curl -V | command awk '{ if ($1 == "curl") print $2 }' | command sed 's/-.*$//g'
474474
}
475475

476476
nvm_version_greater() {

0 commit comments

Comments
 (0)