1 #!/usr/bin/env -S nix shell nixpkgs#nix nixpkgs#curl nixpkgs#jq nixpkgs#nix-prefetch-github --command bash
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
18 "version": "${version_stable#*v}",
19 "hash": "$hash_stable"
22 "version": "${version_beta#*v}",
28 cat $directory/pin.json