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).
()
| 747 | /// `brew --prefix tracedecay`, which survives keg-version bumps and cleanup |
| 748 | /// (unlike the keg-versioned Cellar path the running process resolves to). |
| 749 | fn 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`). |
no test coverage detected