(path: &Path)
| 439 | } |
| 440 | |
| 441 | fn hooks_file_has_current_atomic_hooks(path: &Path) -> bool { |
| 442 | let Ok(config) = read_hooks_file(path) else { |
| 443 | return false; |
| 444 | }; |
| 445 | |
| 446 | CODEX_HOOK_DEFS.iter().all(|spec| { |
| 447 | let command = crate::hooks::guarded_hook_command(spec.command); |
| 448 | config |
| 449 | .hooks |
| 450 | .get(spec.event) |
| 451 | .and_then(Value::as_array) |
| 452 | .is_some_and(|groups| { |
| 453 | groups.iter().any(|group| { |
| 454 | group_has_hook_spec(group, &command, spec.status_message, spec.timeout_sec) |
| 455 | }) |
| 456 | }) |
| 457 | }) |
| 458 | } |
| 459 | |
| 460 | fn add_hook( |
| 461 | hooks: &mut Map<String, Value>, |
no test coverage detected