MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / hooks_file_has_current_atomic_hooks

Function hooks_file_has_current_atomic_hooks

atomic-agent/src/hooks/codex.rs:455–472  ·  view source on GitHub ↗
(path: &Path)

Source from the content-addressed store, hash-verified

453}
454
455fn 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
474fn add_hook(
475 hooks: &mut Map<String, Value>,

Callers 1

is_installed_atMethod · 0.85

Calls 6

read_hooks_fileFunction · 0.85
guarded_hook_commandFunction · 0.85
group_has_hook_specFunction · 0.85
getMethod · 0.65
allMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected