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

Function read_hooks_file

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

Source from the content-addressed store, hash-verified

417}
418
419fn read_hooks_file(path: &Path) -> AgentResult<CodexHooksFile> {
420 if !path.exists() {
421 return Ok(CodexHooksFile::default());
422 }
423 let content = std::fs::read_to_string(path).map_err(|e| AgentError::ConfigError {
424 operation: "read".to_string(),
425 path: path.to_path_buf(),
426 reason: e.to_string(),
427 })?;
428 serde_json::from_str(&content).map_err(|e| AgentError::ConfigError {
429 operation: "parse".to_string(),
430 path: path.to_path_buf(),
431 reason: e.to_string(),
432 })
433}
434
435fn write_hooks_file(path: &Path, config: &CodexHooksFile) -> AgentResult<()> {
436 if let Some(parent) = path.parent() {

Calls 1

existsMethod · 0.45