From 11370fe823c32d458616c62687c198a43f762f21 Mon Sep 17 00:00:00 2001 From: Peter Dave Hello Date: Wed, 14 Jun 2017 10:35:06 +0800 Subject: [PATCH] [Fix] curl should fail if something wrong, fix #1556 --- nvm.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nvm.sh b/nvm.sh index f4aa8da..fc55276 100644 --- a/nvm.sh +++ b/nvm.sh @@ -110,11 +110,12 @@ nvm_download() { if nvm_curl_use_compression; then CURL_COMPRESSED_FLAG="--compressed" fi - curl "${CURL_COMPRESSED_FLAG:-}" -q "$@" + curl --fail "${CURL_COMPRESSED_FLAG:-}" -q "$@" elif nvm_has "wget"; then # Emulate curl with wget ARGS=$(nvm_echo "$@" | command sed -e 's/--progress-bar /--progress=bar /' \ -e 's/--compressed //' \ + -e 's/--fail //' \ -e 's/-L //' \ -e 's/-I /--server-response /' \ -e 's/-s /-q /' \