Skip to content

Commit 11370fe

Browse files
[Fix] curl should fail if something wrong, fix #1556
1 parent cbdd41e commit 11370fe

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

nvm.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,12 @@ nvm_download() {
110110
if nvm_curl_use_compression; then
111111
CURL_COMPRESSED_FLAG="--compressed"
112112
fi
113-
curl "${CURL_COMPRESSED_FLAG:-}" -q "$@"
113+
curl --fail "${CURL_COMPRESSED_FLAG:-}" -q "$@"
114114
elif nvm_has "wget"; then
115115
# Emulate curl with wget
116116
ARGS=$(nvm_echo "$@" | command sed -e 's/--progress-bar /--progress=bar /' \
117117
-e 's/--compressed //' \
118+
-e 's/--fail //' \
118119
-e 's/-L //' \
119120
-e 's/-I /--server-response /' \
120121
-e 's/-s /-q /' \

0 commit comments

Comments
 (0)