-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into content-manifest
- Loading branch information
Showing
24 changed files
with
537 additions
and
562 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
: "${1:?'First argument should be a file containing CORGI ABL array'}" | ||
: "${2:?'Second argument should be a file containing configured books object'}" | ||
|
||
jq --slurp --compact-output ' | ||
.[0] as $corgi_abl | | ||
.[1] as $configured_books | | ||
$corgi_abl | | ||
if (type != "array") then error("Bad ABL data") else . end | | ||
$configured_books | | ||
if (type != "object") then error("Bad book config") else . end | | ||
[ | ||
# Get the newest version of each book | ||
$corgi_abl | group_by(.uuid) | .[] | sort_by(.commited_at) | .[-1] | | ||
# Store information about the entry (uuid and short sha) | ||
.uuid as $uuid | | ||
(.commit_sha | .[0:7]) as $commit_sha | | ||
# Select entries that do not match configured books | ||
select($configured_books | .[$uuid] | .defaultVersion != $commit_sha) | | ||
{ key: .uuid, value: $commit_sha } | ||
] | from_entries | ||
' "$@" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.