[Fix] To confirm curl exists before detecting curl libz feature
parent
e87f395b7a
commit
153f8e7b31
2
nvm.sh
2
nvm.sh
|
@ -82,10 +82,10 @@ nvm_curl_libz_support() {
|
||||||
nvm_get_latest() {
|
nvm_get_latest() {
|
||||||
local NVM_LATEST_URL
|
local NVM_LATEST_URL
|
||||||
local CURL_COMPRESSED_FLAG
|
local CURL_COMPRESSED_FLAG
|
||||||
|
if nvm_has "curl"; then
|
||||||
if nvm_curl_libz_support; then
|
if nvm_curl_libz_support; then
|
||||||
CURL_COMPRESSED_FLAG="--compressed"
|
CURL_COMPRESSED_FLAG="--compressed"
|
||||||
fi
|
fi
|
||||||
if nvm_has "curl"; then
|
|
||||||
NVM_LATEST_URL="$(curl "${CURL_COMPRESSED_FLAG:-}" -q -w "%{url_effective}\n" -L -s -S http://latest.nvm.sh -o /dev/null)"
|
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
|
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 }')"
|
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