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

Function read_hooks_file

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

Source from the content-addressed store, hash-verified

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