mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-05-11 22:51:51 +00:00
[Fix] To confirm curl exists before detecting curl libz feature
This commit is contained in:
parent
ec3ba1973a
commit
daa9c3604d
8
nvm.sh
8
nvm.sh
@ -76,7 +76,7 @@ nvm_has_colors() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
nvm_curl_libz_support() {
|
nvm_curl_libz_support() {
|
||||||
curl -V | grep "^Features:" | grep -q "libz"
|
curl -V 2>/dev/null | nvm_grep "^Features:" | nvm_grep -q "libz"
|
||||||
}
|
}
|
||||||
|
|
||||||
nvm_get_latest() {
|
nvm_get_latest() {
|
||||||
@ -102,10 +102,10 @@ nvm_get_latest() {
|
|||||||
|
|
||||||
nvm_download() {
|
nvm_download() {
|
||||||
local CURL_COMPRESSED_FLAG
|
local CURL_COMPRESSED_FLAG
|
||||||
if nvm_curl_libz_support; then
|
|
||||||
CURL_COMPRESSED_FLAG="--compressed"
|
|
||||||
fi
|
|
||||||
if nvm_has "curl"; then
|
if nvm_has "curl"; then
|
||||||
|
if nvm_curl_libz_support; then
|
||||||
|
CURL_COMPRESSED_FLAG="--compressed"
|
||||||
|
fi
|
||||||
curl "${CURL_COMPRESSED_FLAG:-}" -q "$@"
|
curl "${CURL_COMPRESSED_FLAG:-}" -q "$@"
|
||||||
elif nvm_has "wget"; then
|
elif nvm_has "wget"; then
|
||||||
# Emulate curl with wget
|
# Emulate curl with wget
|
||||||
|
Loading…
Reference in New Issue
Block a user