mirror of
https://github.com/mitchellh/zig-overlay.git
synced 2025-02-05 08:52:48 +02:00
Improve method of retrieving tagged releases
This commit is contained in:
parent
1a47dc4b55
commit
12ee2c75b7
2 changed files with 15 additions and 18 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,3 +1,2 @@
|
|||
sources.old.json
|
||||
sources.new.json
|
||||
sources.new2.json
|
||||
|
|
14
update
14
update
|
@ -17,9 +17,10 @@ def toentry(vsn; x):
|
|||
"version": $version,
|
||||
}
|
||||
}
|
||||
)] | add;
|
||||
)] | add | first(values, {});
|
||||
|
||||
to_entries[] | {
|
||||
reduce to_entries[] as $entry ({}; . * (
|
||||
$entry | {
|
||||
(.key): (
|
||||
if (.key != "master") then
|
||||
toentry(.key; .value)
|
||||
|
@ -28,13 +29,10 @@ to_entries[] | {
|
|||
(.value.date): toentry(.value.version; .value),
|
||||
} end
|
||||
)
|
||||
}
|
||||
}
|
||||
))
|
||||
' > 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
|
||||
# cat sources.new.json
|
||||
# exit
|
||||
|
@ -43,4 +41,4 @@ jq -s add sources.new.json > sources.new2.json
|
|||
cp sources.json sources.old.json
|
||||
|
||||
# Recursive merge
|
||||
jq -s '.[0] * .[1]' sources.old.json sources.new2.json > sources.json
|
||||
jq -s '.[0] * .[1]' sources.old.json sources.new.json > sources.json
|
||||
|
|
Loading…
Add table
Reference in a new issue