From daa9c3604dfb8cfcf2de14deb65e4746a15245ee Mon Sep 17 00:00:00 2001 From: Peter Dave Hello Date: Thu, 6 Apr 2017 05:20:55 +0800 Subject: [PATCH] [Fix] To confirm curl exists before detecting curl libz feature --- nvm.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nvm.sh b/nvm.sh index 184440a..b24c640 100644 --- a/nvm.sh +++ b/nvm.sh @@ -76,7 +76,7 @@ nvm_has_colors() { } 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() { @@ -102,10 +102,10 @@ nvm_get_latest() { nvm_download() { 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 curl "${CURL_COMPRESSED_FLAG:-}" -q "$@" elif nvm_has "wget"; then # Emulate curl with wget