Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix(cli): canonicalize symlink path in doctor version info

Richie McIlroy96a08b00d2ab
diff --git a/apps/cli/src/doctor.rs b/apps/cli/src/doctor.rs
index 157a9b098..6faa07de5 100644
--- a/apps/cli/src/doctor.rs
+++ b/apps/cli/src/doctor.rs
@@ -73,7 +73,12 @@ pub struct VersionInfo {
impl VersionInfo {
pub fn collect() -> Self {
- let exe = std::env::current_exe().ok();
+ // The CLI is normally invoked through the installed shim (a symlink), and on macOS
+ // `current_exe()` returns that symlink path verbatim — so resolve it to the real binary before
+ // deriving distribution/bundle/sidecar paths, which all live next to the real executable.
+ let exe = std::env::current_exe()
+ .ok()
+ .map(|exe| std::fs::canonicalize(&exe).unwrap_or(exe));
let distribution = exe
.as_deref()
.map(distribution)