Skip to content

Commit

Permalink
Merge pull request #70882 from BrettDong/fix-jq
Browse files Browse the repository at this point in the history
Handle standalone objects and non-objects in mission om_special check script
  • Loading branch information
Maleclypse authored Jan 14, 2024
2 parents bfa956e + cd287b2 commit 135a491
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tools/json_tools/assign_mission_target_needs_om_special.bash
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ function Q {

SPECIAL_OF_TERRAIN="$(mktemp --suffix -special-of-terrain.json )"
Q 'def skip(to_skip): select(all(. != to_skip; .));
.[]
if type=="array" then .[] else . end
| select(type=="object")
| select(.type=="overmap_special")
| .id as $id
| .overmaps[].overmap
Expand All @@ -27,7 +28,8 @@ Q 'def skip(to_skip): select(all(. != to_skip; .));

MISSING_OM_SPECIAL="$(mktemp --suffix -missing-om-special.json )"
Q --slurpfile special_of_terrain "$SPECIAL_OF_TERRAIN" \
'.[]
'if type=="array" then .[] else . end
| select(type=="object")
| select(.type=="mission_definition")
| .id as $id
| .start?.assign_mission_target?
Expand Down

0 comments on commit 135a491

Please sign in to comment.