From 153f8e7b316a3ea284b23abf5efe2546923778b8 Mon Sep 17 00:00:00 2001 From: Peter Dave Hello Date: Sun, 9 Apr 2017 13:44:07 +0800 Subject: [PATCH] [Fix] To confirm curl exists before detecting curl libz feature --- nvm.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nvm.sh b/nvm.sh index cc92be0..7b1170c 100644 --- a/nvm.sh +++ b/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 }')"