treewide: curl: exit with error status on HTTP errors

This makes scripts fail early on request errors.
Previously, curl exited with status 0 when enountering HTTP error status
codes.
`-fsS` equals `--fail --silent --show-error`.
This commit is contained in:
Erik Arvstedt 2022-05-17 13:18:38 +02:00
parent 63b3eec9cd
commit 84fe731c94
No known key found for this signature in database
GPG key ID: 33312B944DD97846
4 changed files with 8 additions and 8 deletions

View file

@ -8,7 +8,7 @@ trap 'echo "Error at ${BASH_SOURCE[0]}, line $LINENO"' ERR
repo=fort-nix/nix-bitcoin
if [[ ! -v version ]]; then
version=$(curl -s --show-error "https://api.github.com/repos/$repo/releases/latest" | jq -r '.tag_name' | tail -c +2)
version=$(curl -fsS "https://api.github.com/repos/$repo/releases/latest" | jq -r '.tag_name' | tail -c +2)
fi
TMPDIR=$(mktemp -d)
@ -27,8 +27,8 @@ gpg --list-keys "36C7 1A37 C9D9 88BD E825 08D9 B1A7 0E4F 8DCD 0366" > /dev/null
# Fetch nar-hash of release
cd $TMPDIR
baseUrl=https://github.com/$repo/releases/download/v$version
curl -s --show-error -L -O $baseUrl/nar-hash.txt
curl -s --show-error -L -O $baseUrl/nar-hash.txt.asc
curl -fsS -L -O $baseUrl/nar-hash.txt
curl -fsS -L -O $baseUrl/nar-hash.txt.asc
# Verify signature for nar-hash
gpg --verify nar-hash.txt.asc &> /dev/null || {