evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / by-name / ma / maa-assistant-arknights / update.sh
blob50cff9d38d783dbf1074179750853af700f0c465
1 #!/usr/bin/env -S nix shell nixpkgs#nix nixpkgs#curl nixpkgs#jq nixpkgs#nix-prefetch-github --command bash
3 set -euo pipefail
5 directory="$(dirname $0 | xargs realpath)"
7 version_stable="$(curl "https://api.github.com/repos/MaaAssistantArknights/MaaAssistantArknights/releases/latest" | jq -r '.tag_name')"
9 hash_stable=$(nix-prefetch-github MaaAssistantArknights MaaAssistantArknights --rev ${version_stable} -v | jq -r .hash)
11 version_beta="$(curl "https://api.github.com/repos/MaaAssistantArknights/MaaAssistantArknights/releases?per_page=1" | jq -r '.[0].tag_name')"
13 hash_beta=$(nix-prefetch-github MaaAssistantArknights MaaAssistantArknights --rev ${version_beta} -v | jq -r .hash)
15 cat > $directory/pin.json << EOF
17 "stable": {
18 "version": "${version_stable#*v}",
19 "hash": "$hash_stable"
21 "beta": {
22 "version": "${version_beta#*v}",
23 "hash": "$hash_beta"
26 EOF
28 cat $directory/pin.json