Skip to content

Commit

Permalink
update hashupdate script
Browse files Browse the repository at this point in the history
  • Loading branch information
rob93c committed Dec 21, 2024
1 parent add6458 commit 8101717
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hashupdate
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/sh
set -eu
set -eu pipefail

# Usage: hashupdate <FILE> <NAME> <VERSION>
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"

0 comments on commit 8101717

Please sign in to comment.