Skip to content

Commit

Permalink
chore: Show curl download errors in install script
Browse files Browse the repository at this point in the history
This adds two options to curl downloads in the install script:

* `-f` (long version `--fail`), which tells curl to fail fast on server
  errors.

* `-S` (long version `--show-error`) which tells curl to show an error
  when it fails.
  • Loading branch information
twpayne committed Oct 5, 2024
1 parent cdfdf00 commit a9f877a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions assets/scripts/install-local-bin.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions assets/scripts/install.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions internal/cmds/generate-install.sh/install.sh.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,9 @@ http_download_curl() {
source_url="${2}"
header="${3}"
if [ -z "${header}" ]; then
code="$(curl -w '%{http_code}' -sL -o "${local_file}" "${source_url}")"
code="$(curl -w '%{http_code}' -fsSL -o "${local_file}" "${source_url}")"
else
code="$(curl -w '%{http_code}' -sL -H "${header}" -o "${local_file}" "${source_url}")"
code="$(curl -w '%{http_code}' -fsSL -H "${header}" -o "${local_file}" "${source_url}")"
fi
if [ "${code}" != "200" ]; then
log_debug "http_download_curl received HTTP status ${code}"
Expand Down

0 comments on commit a9f877a

Please sign in to comment.