From 52aaa8388e1faef7ba0074217fe20e7b47e9a914 Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Mon, 13 Sep 2021 10:19:30 +0200 Subject: [PATCH] fetch-release: write error messages to stderr Previously, when used to update `nix-bitcoin-release`, the error wasn't displayed but instead written to `nix-bitcoin-release`. Also, show curl error messages. --- helper/fetch-release | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/helper/fetch-release b/helper/fetch-release index 2fe87ee..dfac325 100755 --- a/helper/fetch-release +++ b/helper/fetch-release @@ -6,7 +6,7 @@ scriptDir=$(cd "${BASH_SOURCE[0]%/*}" && pwd) repo=fort-nix/nix-bitcoin if [[ ! -v version ]]; then - version=$(curl --silent "https://api.github.com/repos/$repo/releases/latest" | jq -r '.tag_name' | tail -c +2) + version=$(curl -s --show-error "https://api.github.com/repos/$repo/releases/latest" | jq -r '.tag_name' | tail -c +2) fi TMPDIR=$(mktemp -d) @@ -23,12 +23,12 @@ gpg --homedir $GPG_HOME --list-keys 36C71A37C9D988BDE82508D9B1A70E4F8DCD0366 > / # Fetch nar-hash of release cd $TMPDIR baseUrl=https://github.com/$repo/releases/download/v$version -curl --silent -L -O $baseUrl/nar-hash.txt -curl --silent -L -O $baseUrl/nar-hash.txt.asc +curl -s --show-error -L -O $baseUrl/nar-hash.txt +curl -s --show-error -L -O $baseUrl/nar-hash.txt.asc # Verify signature for nar-hash gpg --homedir $GPG_HOME --verify nar-hash.txt.asc &> /dev/null || { - echo "Error: Signature verification failed. Please open an issue in the project repository." + >&2 echo "Error: Signature verification failed. Please open an issue in the project repository." exit 1 }