diff --git a/hashupdate b/hashupdate index a202c37..943beae 100644 --- a/hashupdate +++ b/hashupdate @@ -1,8 +1,8 @@ #!/bin/sh -set -eu +set -eu pipefail # Usage: hashupdate -URL_TEMPLATE=$(grep "$2_URL=" "$1" | sed -E 's/.*="(.*)"/\1/' | tr -d '\r') +URL_TEMPLATE=$(grep "$2_URL=" "$1" | sed -E 's/.*="(.*)"/\1/') URL=$(echo "$URL_TEMPLATE" | sed "s/\$$2_VERSION/$3/g") SHA256=$(curl -sL "$URL" | sha256sum | sed -e 's/ -//g') sed -i -E "s/$2_SHA256=.*/$2_SHA256=$SHA256/" "$1"