From 5fce714ba55892702069e6df36666baf14c751a3 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Fri, 15 Mar 2024 11:56:33 +0200 Subject: [PATCH] cli: include path to rad binary in rad-debug This relies on /proc/self/exe being a symlink to the binary, so this may only work on Linux. Signed-off-by: Lars Wirzenius --- radicle-cli/src/commands/debug.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/radicle-cli/src/commands/debug.rs b/radicle-cli/src/commands/debug.rs index 55c71a5f..9852b7d0 100644 --- a/radicle-cli/src/commands/debug.rs +++ b/radicle-cli/src/commands/debug.rs @@ -68,6 +68,11 @@ fn debug(profile: &Profile) -> anyhow::Result<()> { })); let debug = DebugInfo { + rad_exe: if let Ok(filename) = std::fs::read_link("/proc/self/exe") { + Some(filename) + } else { + None + }, rad_version: VERSION, radicle_node_version: stdout_of("radicle-node", &["--version"]) .unwrap_or("".into()), @@ -92,6 +97,7 @@ fn debug(profile: &Profile) -> anyhow::Result<()> { #[allow(dead_code)] #[serde(rename_all = "camelCase")] struct DebugInfo { + rad_exe: Option, rad_version: &'static str, radicle_node_version: String, git_remote_rad_version: String,