fix: client auto-restart after update + delete old binary
This commit is contained in:
parent
33e1e4d550
commit
8e7b465538
1 changed files with 5 additions and 2 deletions
|
|
@ -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");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue