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

Function install_hooks_at

atomic-agent/src/hooks/codex.rs:339–359  ·  view source on GitHub ↗
(path: &Path, force: bool)

Source from the content-addressed store, hash-verified

337}
338
339fn install_hooks_at(path: &Path, force: bool) -> AgentResult<usize> {
340 let mut config = read_hooks_file(path)?;
341 if force {
342 remove_atomic_hooks(&mut config.hooks);
343 }
344
345 let mut installed = 0;
346 for spec in CODEX_HOOK_DEFS {
347 if add_hook(
348 &mut config.hooks,
349 spec.event,
350 spec.command,
351 spec.status_message,
352 ) {
353 installed += 1;
354 }
355 }
356
357 write_hooks_file(path, &config)?;
358 Ok(installed)
359}
360
361fn uninstall_hooks_at(path: &Path) -> AgentResult<()> {
362 if !path.exists() {

Callers 3

install_globalMethod · 0.85
installMethod · 0.85

Calls 4

read_hooks_fileFunction · 0.85
add_hookFunction · 0.85
write_hooks_fileFunction · 0.85
remove_atomic_hooksFunction · 0.70

Tested by 1