Skip to content

Commit

Permalink
give more useful error message on download failure, make curl fail on…
Browse files Browse the repository at this point in the history
… failure
  • Loading branch information
Bryce Larson committed Jun 17, 2020
1 parent 1e86c22 commit 1081d96
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bootstrap-salt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -792,11 +792,12 @@ fi
#----------------------------------------------------------------------------------------------------------------------
__fetch_url() {
# shellcheck disable=SC2086
curl $_CURL_ARGS -L -s -o "$1" "$2" >/dev/null 2>&1 ||
curl $_CURL_ARGS -L -s -f -o "$1" "$2" >/dev/null 2>&1 ||
wget $_WGET_ARGS -q -O "$1" "$2" >/dev/null 2>&1 ||
fetch $_FETCH_ARGS -q -o "$1" "$2" >/dev/null 2>&1 || # FreeBSD
fetch -q -o "$1" "$2" >/dev/null 2>&1 || # Pre FreeBSD 10
ftp -o "$1" "$2" >/dev/null 2>&1 # OpenBSD
ftp -o "$1" "$2" >/dev/null 2>&1 || # OpenBSD
(echoerror "$2 failed to download to $1"; exit 1)
}

#--- FUNCTION -------------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit 1081d96

Please sign in to comment.