1 #!/usr/bin/env nix-shell
2 #!nix-shell -i bash -p nix curl jq prefetch-yarn-deps nix-prefetch-github
6 if [[ "$#" -gt 1 ||
"$1" == -* ]]; then
7 echo "Regenerates packaging data for jellyseerr."
8 echo "Usage: $0 [git release tag]"
14 if [ -z "$tag" ]; then
16 curl "https
://api.github.com
/repos
/Fallenbagel
/jellyseerr
/releases?per_page
=1" |
21 src
="https://raw.githubusercontent.com/Fallenbagel/jellyseerr/$tag"
22 src_hash
=$
(nix-prefetch-github Fallenbagel jellyseerr
--rev ${tag} | jq
-r .sha256
)
25 trap 'rm -rf "$tmpdir"' EXIT
28 curl
-O "$src/yarn.lock"
29 yarn_sha256
=$
(prefetch-yarn-deps yarn.lock
)
32 curl
-O "$src/package.json"
35 "version": "$(echo $tag | grep -P '(\d|\.)+' -o)",
36 "srcHash": "sha256-$src_hash",
37 "yarnSha256": "$yarn_sha256"