1 #!/usr/bin/env nix-shell
2 #!nix-shell -i bash -p curl gnused nix-prefetch jq
6 dirname="$(dirname "$0")"
18 url
="https://github.com/Prowlarr/Prowlarr/releases/download/v$version/Prowlarr.master.$version.$os-core-$arch.tar.gz"
19 hash=$
(nix-prefetch-url
--type sha256
$url)
20 sriHash
="$(nix hash to-sri --type sha256 $hash)"
22 sed -i "s|$system = \"sha256-[a-zA-Z0-9\/+-=]*\";|$system = \"$sriHash\";|g" "$dirname/default.nix"
27 sed -i "s/version = \"[0-9.]*\";/version = \"$1\";/g" "$dirname/default.nix"
30 currentVersion
=$
(cd $dirname && nix
eval --raw -f ..
/..
/.. prowlarr.version
)
32 latestTag
=$
(curl https
://api.github.com
/repos
/Prowlarr
/Prowlarr
/releases
/latest | jq
-r ".tag_name")
33 latestVersion
="$(expr $latestTag : 'v\(.*\)')"
35 if [[ "$currentVersion" == "$latestVersion" ]]; then
36 echo "Prowlarr is up-to-date: ${currentVersion}"
40 updateVersion
$latestVersion
42 updateHash
$latestVersion aarch64-darwin arm64 osx
43 updateHash
$latestVersion aarch64-linux arm64 linux
44 updateHash
$latestVersion x86_64-darwin x64 osx
45 updateHash
$latestVersion x86_64-linux x64 linux