1 #!/usr/bin/env nix-shell
2 #!nix-shell -i bash -p bash curl coreutils jq common-updater-scripts
4 latestTag
=$
(curl
-sSfL https
://www.snipaste.com
/linux_version | jq
-r ".subject")
5 latestVersion
="$(expr "$latestTag" : 'v\(.*\)')"
6 currentVersion
=$
(nix-instantiate
--eval -E "with import ./. {}; snipaste.version" |
tr -d '"')
8 if [[ "$latestVersion" == "$currentVersion" ]]; then
9 echo "package is up-to-date"
13 prefetch
=$
(nix-prefetch-url
"https://download.snipaste.com/archives/Snipaste-$latestVersion-x86_64.AppImage")
14 hash=$
(nix-hash
--type sha256
--to-sri "$prefetch")
15 update-source-version snipaste
"$latestVersion" "$hash" --ignore-same-version