[Fix] To confirm curl exists before detecting curl libz feature
parent
e87f395b7a
commit
153f8e7b31
6
nvm.sh
6
nvm.sh
|
@ -82,10 +82,10 @@ nvm_curl_libz_support() {
|
|||
nvm_get_latest() {
|
||||
local NVM_LATEST_URL
|
||||
local CURL_COMPRESSED_FLAG
|
||||
if nvm_curl_libz_support; then
|
||||
CURL_COMPRESSED_FLAG="--compressed"
|
||||
fi
|
||||
if nvm_has "curl"; then
|
||||
if nvm_curl_libz_support; then
|
||||
CURL_COMPRESSED_FLAG="--compressed"
|
||||
fi
|
||||
NVM_LATEST_URL="$(curl "${CURL_COMPRESSED_FLAG:-}" -q -w "%{url_effective}\n" -L -s -S http://latest.nvm.sh -o /dev/null)"
|
||||
elif nvm_has "wget"; then
|
||||
NVM_LATEST_URL="$(wget http://latest.nvm.sh --server-response -O /dev/null 2>&1 | command awk '/^ Location: /{DEST=$2} END{ print DEST }')"
|
||||
|
|
Loading…
Reference in New Issue