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

Function read_hooks_file

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

Source from the content-addressed store, hash-verified

364}
365
366fn read_hooks_file(path: &Path) -> AgentResult<CodexHooksFile> {
367 if !path.exists() {
368 return Ok(CodexHooksFile::default());
369 }
370 let content = std::fs::read_to_string(path).map_err(|e| AgentError::ConfigError {
371 operation: "read".to_string(),
372 path: path.to_path_buf(),
373 reason: e.to_string(),
374 })?;
375 serde_json::from_str(&content).map_err(|e| AgentError::ConfigError {
376 operation: "parse".to_string(),
377 path: path.to_path_buf(),
378 reason: e.to_string(),
379 })
380}
381
382fn write_hooks_file(path: &Path, config: &CodexHooksFile) -> AgentResult<()> {
383 if let Some(parent) = path.parent() {

Callers 3

install_hooks_atFunction · 0.85
uninstall_hooks_atFunction · 0.85

Calls 1

existsMethod · 0.45

Tested by 1