implement jq suggestions

This commit is contained in:
miampf 2025-02-27 13:14:45 +01:00
parent 9c7fc954ee
commit 69864e8ce7
No known key found for this signature in database
GPG Key ID: EF039364B5B6886C

View File

@ -14,16 +14,12 @@ for directory in "$1"/system/!(mkosi_wrapper.sh); do
.list.[]
| select(
.attestationVariant == $attestation_variant
and (.csp | ascii_downcase) == $csp
)
| select((.csp | ascii_downcase) == $csp)
| .measurements
| walk(
if (
type=="object" and .warnOnly
)
then del(.) else . end
)
| del(..|nulls)
| to_entries
| map(select(.value.warnOnly | not))
| from_entries
| del(.[] .warnOnly)
' \
measurements.json > "$attestationVariant"_their-measurements.json