(path: &Path)
| 453 | } |
| 454 | |
| 455 | fn hooks_file_has_current_atomic_hooks(path: &Path) -> bool { |
| 456 | let Ok(config) = read_hooks_file(path) else { |
| 457 | return false; |
| 458 | }; |
| 459 | |
| 460 | CODEX_HOOK_DEFS.iter().all(|spec| { |
| 461 | let command = crate::hooks::guarded_hook_command(spec.command); |
| 462 | config |
| 463 | .hooks |
| 464 | .get(spec.event) |
| 465 | .and_then(Value::as_array) |
| 466 | .is_some_and(|groups| { |
| 467 | groups.iter().any(|group| { |
| 468 | group_has_hook_spec(group, &command, spec.status_message, spec.timeout_sec) |
| 469 | }) |
| 470 | }) |
| 471 | }) |
| 472 | } |
| 473 | |
| 474 | fn add_hook( |
| 475 | hooks: &mut Map<String, Value>, |
no test coverage detected