MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / brew_linked_binary

Function brew_linked_binary

src/upgrade.rs:749–760  ·  view source on GitHub ↗

The stable Homebrew-managed binary path: the opt symlink reported by `brew --prefix tracedecay`, which survives keg-version bumps and cleanup (unlike the keg-versioned Cellar path the running process resolves to).

()

Source from the content-addressed store, hash-verified

747/// `brew --prefix tracedecay`, which survives keg-version bumps and cleanup
748/// (unlike the keg-versioned Cellar path the running process resolves to).
749fn brew_linked_binary() -> Option<PathBuf> {
750 let output = std::process::Command::new("brew")
751 .args(["--prefix", "tracedecay"])
752 .output()
753 .ok()?;
754 if !output.status.success() {
755 return None;
756 }
757 let prefix = String::from_utf8(output.stdout).ok()?;
758 let binary = Path::new(prefix.trim()).join("bin").join("tracedecay");
759 binary.exists().then_some(binary)
760}
761
762/// Extracts the version from `tracedecay --version` output
763/// (e.g. `tracedecay 5.0.1` → `5.0.1`).

Callers 1

run_brew_upgradeFunction · 0.85

Calls 3

outputMethod · 0.80
successMethod · 0.80
existsMethod · 0.80

Tested by

no test coverage detected