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

Method is_installed_in

atomic-agent/src/hooks/agy.rs:561–578  ·  view source on GitHub ↗

Check whether Atomic hooks are installed in the plugin hooks file.

(config_dir: &Path)

Source from the content-addressed store, hash-verified

559
560 /// Check whether Atomic hooks are installed in the plugin hooks file.
561 fn is_installed_in(config_dir: &Path) -> bool {
562 let hooks_path = Self::hooks_path(config_dir);
563 if !hooks_path.exists() {
564 return false;
565 }
566
567 match Self::read_hooks_file(&hooks_path) {
568 Ok(groups) => groups
569 .get(ATOMIC_GROUP)
570 .map(group_has_atomic_commands)
571 .unwrap_or(false),
572 // Tolerate unparseable files (possible hand edits) by falling
573 // back to a raw content scan.
574 Err(_) => std::fs::read_to_string(&hooks_path)
575 .map(|content| content.contains(ATOMIC_HOOK_PREFIX))
576 .unwrap_or(false),
577 }
578 }
579
580 // Import manifest management
581

Callers

nothing calls this directly

Calls 4

read_hooks_fileFunction · 0.85
getMethod · 0.65
existsMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected