add sri script for easy updates

TODO: Make this a nix common-updater script.
This commit is contained in:
Joseph Hanson 2024-09-05 21:42:01 -05:00
parent 617822c63e
commit e5714f305a
Signed by: jahanson
SSH key fingerprint: SHA256:vy6dKBECV522aPAwklFM3ReKAVB086rT3oWwiuiFG7o

View file

@ -0,0 +1,10 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl jq nix
VERSION=$(curl -H 'X-Ubuntu-Series: 16' https://api.snapcraft.io/api/v1/snaps/details/termius-app | jq '.version')
DOWNLOAD_URL=$(curl -H 'X-Ubuntu-Series: 16' https://api.snapcraft.io/api/v1/snaps/details/termius-app | jq '.download_url' -r)
SHASUM=$(curl -H 'X-Ubuntu-Series: 16' https://api.snapcraft.io/api/v1/snaps/details/termius-app | jq '.download_sha512' -r)
SRI512SUM=$(nix-hash --type sha512 --to-sri $SHASUM)
echo "The latest SRI for version $VERSION is "
echo "$SRI512SUM"