mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-11-29 22:10:31 +08:00
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 <liw@liw.fi>
This commit is contained in:
@@ -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("<unknown>".into()),
|
||||
@@ -92,6 +97,7 @@ fn debug(profile: &Profile) -> anyhow::Result<()> {
|
||||
#[allow(dead_code)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
struct DebugInfo {
|
||||
rad_exe: Option<PathBuf>,
|
||||
rad_version: &'static str,
|
||||
radicle_node_version: String,
|
||||
git_remote_rad_version: String,
|
||||
|
||||
Reference in New Issue
Block a user