From 637bf5c81223a56f94bb61c74711a7619f444f8a Mon Sep 17 00:00:00 2001 From: ADD-SP Date: Sun, 15 Feb 2026 23:05:28 +0000 Subject: [PATCH] fix: do not remove self (binary) on `clawshell uninstall` --- src/main.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/main.rs b/src/main.rs index 47b2f0b..879704b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -839,7 +839,7 @@ fn cmd_uninstall(skip_confirm: bool) -> Result<(), Box> { if service_exists { tui::print_info("Service", &service_path.display().to_string()); } - tui::print_info("Binary", &exe_path.display().to_string()); + tui::print_info("Binary", &format!("{} (preserved)", exe_path.display())); tui::print_info("System user", "clawshell"); println!(); @@ -949,13 +949,11 @@ fn cmd_uninstall(skip_confirm: bool) -> Result<(), Box> { } } - // 7. Remove the binary itself (do this last) + // 7. Preserve the binary so users can still run clawshell later. if exe_path.exists() { - if let Err(e) = std::fs::remove_file(&exe_path) { - tui::print_warning(&format!("Could not remove binary: {e}.")); - } else { - tui::print_success("Binary removed."); - } + tui::print_info("Binary", &format!("Preserved at {}", exe_path.display())); + } else { + tui::print_warning("Binary path no longer exists; skipping binary preservation check."); } println!();