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:441–458  ·  view source on GitHub ↗
(path: &Path)

Source from the content-addressed store, hash-verified

439}
440
441fn 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
460fn add_hook(
461 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