True when any handler command in `group` contains `subcommand`.
(group: &serde_json::Value, subcommand: &str)
| 1100 | |
| 1101 | /// True when any handler command in `group` contains `subcommand`. |
| 1102 | fn group_has_subcommand(group: &serde_json::Value, subcommand: &str) -> bool { |
| 1103 | group["hooks"].as_array().is_some_and(|handlers| { |
| 1104 | handlers.iter().any(|h| { |
| 1105 | h.get("command") |
| 1106 | .and_then(|c| c.as_str()) |
| 1107 | .is_some_and(|command| command.contains(subcommand)) |
| 1108 | }) |
| 1109 | }) |
| 1110 | } |
| 1111 | |
| 1112 | /// Codex requires non-managed command hooks to be trusted via `/hooks` before |
| 1113 | /// they run; newly installed/changed hooks are skipped until trusted. |
no test coverage detected