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

Function install_hooks_at

atomic-agent/src/hooks/codex.rs:339–355  ·  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 let command = crate::hooks::guarded_hook_command(spec.command);
348 if add_hook(&mut config.hooks, spec.event, &command, spec.status_message) {
349 installed += 1;
350 }
351 }
352
353 write_hooks_file(path, &config)?;
354 Ok(installed)
355}
356
357fn uninstall_hooks_at(path: &Path) -> AgentResult<()> {
358 if !path.exists() {

Callers 3

install_globalMethod · 0.85
installMethod · 0.85

Calls 5

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

Tested by 1