fix: client auto-restart after update + delete old binary

This commit is contained in:
Helios Agent 2026-03-06 14:07:19 +01:00
parent 33e1e4d550
commit 8e7b465538
No known key found for this signature in database
GPG key ID: C8259547CD8309B5

View file

@ -710,8 +710,11 @@ async fn handle_message(
return; return;
} }
display::cmd_done("🔄", "update", "", true, "updated — restarting"); display::cmd_done("🔄", "update", "", true, "updated — restarting");
// Restart // Delete old binary
let _ = std::process::Command::new(&exe).spawn(); let _ = std::fs::remove_file(&old);
// Restart with same args
let args: Vec<String> = std::env::args().skip(1).collect();
let _ = std::process::Command::new(&exe).args(&args).spawn();
std::process::exit(0); std::process::exit(0);
}); });
display::cmd_done("🔄", "update", "", true, "triggered"); display::cmd_done("🔄", "update", "", true, "triggered");