biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / servers / jellyseerr / update.sh
blob719fc622a6e4c563e7df4d44ac1970267dcdb77b
1 #!/usr/bin/env nix-shell
2 #!nix-shell -i bash -p nix curl jq prefetch-yarn-deps nix-prefetch-github
4 set -euo pipefail
6 if [[ "$#" -gt 1 || "$1" == -* ]]; then
7 echo "Regenerates packaging data for jellyseerr."
8 echo "Usage: $0 [git release tag]"
9 exit 1
12 tag="$1"
14 if [ -z "$tag" ]; then
15 tag="$(
16 curl "https://api.github.com/repos/Fallenbagel/jellyseerr/releases?per_page=1" |
17 jq -r '.[0].tag_name'
21 src="https://raw.githubusercontent.com/Fallenbagel/jellyseerr/$tag"
22 src_hash=$(nix-prefetch-github Fallenbagel jellyseerr --rev ${tag} | jq -r .sha256)
24 tmpdir=$(mktemp -d)
25 trap 'rm -rf "$tmpdir"' EXIT
27 pushd $tmpdir
28 curl -O "$src/yarn.lock"
29 yarn_sha256=$(prefetch-yarn-deps yarn.lock)
30 popd
32 curl -O "$src/package.json"
33 cat > pin.json << EOF
35 "version": "$(echo $tag | grep -P '(\d|\.)+' -o)",
36 "srcHash": "sha256-$src_hash",
37 "yarnSha256": "$yarn_sha256"
39 EOF