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

Function read_hooks_file

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

Source from the content-addressed store, hash-verified

403}
404
405fn read_hooks_file(path: &Path) -> AgentResult<CodexHooksFile> {
406 if !path.exists() {
407 return Ok(CodexHooksFile::default());
408 }
409 let content = std::fs::read_to_string(path).map_err(|e| AgentError::ConfigError {
410 operation: "read".to_string(),
411 path: path.to_path_buf(),
412 reason: e.to_string(),
413 })?;
414 serde_json::from_str(&content).map_err(|e| AgentError::ConfigError {
415 operation: "parse".to_string(),
416 path: path.to_path_buf(),
417 reason: e.to_string(),
418 })
419}
420
421fn write_hooks_file(path: &Path, config: &CodexHooksFile) -> AgentResult<()> {
422 if let Some(parent) = path.parent() {

Calls 1

existsMethod · 0.45