1 #!/usr/bin/env nix-shell
2 #!nix-shell -i bash -p curl gnused nix-prefetch jq
6 dirname="$(dirname "$0")"
14 hashKey
="${arch}-${os}_hash"
16 url
="https://github.com/Ombi-app/Ombi/releases/download/v$version/$os-$arch.tar.gz"
17 hash=$
(nix-prefetch-url
--type sha256
$url)
18 sriHash
="$(nix hash to-sri --type sha256 $hash)"
20 sed -i "s|$hashKey = \"[a-zA-Z0-9\/+-=]*\";|$hashKey = \"$sriHash\";|g" "$dirname/default.nix"
25 sed -i "s/version = \"[0-9.]*\";/version = \"$1\";/g" "$dirname/default.nix"
28 currentVersion
=$
(cd $dirname && nix
eval --raw -f ..
/..
/.. ombi.version
)
30 latestTag
=$
(curl https
://api.github.com
/repos
/Ombi-App
/Ombi
/releases
/latest | jq
-r ".tag_name")
31 latestVersion
="$(expr $latestTag : 'v\(.*\)')"
33 if [[ "$currentVersion" == "$latestVersion" ]]; then
34 echo "Ombi is up-to-date: ${currentVersion}"
38 updateVersion
$latestVersion
40 updateHash
$latestVersion x64 linux
41 updateHash
$latestVersion arm64 linux
42 updateHash
$latestVersion x64 osx