Get new tagged releases

This commit is contained in:
Mitchell Hashimoto 2022-10-31 21:20:31 -07:00
parent 9a32e40c79
commit 9c1e76fa14
No known key found for this signature in database
GPG key ID: 523D5DC389D273BC
2 changed files with 7 additions and 2 deletions

1
.gitignore vendored
View file

@ -1,2 +1,3 @@
sources.old.json sources.old.json
sources.new.json sources.new.json
sources.new2.json

8
update
View file

@ -4,7 +4,7 @@ set -e
# Build our new sources.json # Build our new sources.json
curl -s 'https://ziglang.org/download/index.json' | jq ' curl -s 'https://ziglang.org/download/index.json' | jq '
["aarch64-linux", "x86_64-linux", "aarch64-macos", "x86_64-macos"] as $targets | ["aarch64-linux", "x86_64-linux", "aarch64-macos", "x86_64-macos", "aarch64-windows", "x86_64-windows"] as $targets |
def todarwin(x): x | gsub("macos"; "darwin"); def todarwin(x): x | gsub("macos"; "darwin");
def toentry(vsn; x): def toentry(vsn; x):
[(vsn as $version | [(vsn as $version |
@ -31,6 +31,10 @@ to_entries[] | {
} }
' > sources.new.json ' > sources.new.json
# Merge all of the objects from the previous step. Maybe there is a way
# to do this in one command (probably), but I don't know how!
jq -s add sources.new.json > sources.new2.json
# For debugging # For debugging
# cat sources.new.json # cat sources.new.json
# exit # exit
@ -39,4 +43,4 @@ to_entries[] | {
cp sources.json sources.old.json cp sources.json sources.old.json
# Recursive merge # Recursive merge
jq -s '.[0] * .[1]' sources.old.json sources.new.json > sources.json jq -s '.[0] * .[1]' sources.old.json sources.new2.json > sources.json