linux: Store binary path before restart to handle deleted binary file (#11568)
This fixes restart after updates not working on Linux. On Linux we can't reliably get the binary path after an update, because the original binary was deleted and the path will contain ` (deleted)`. See: https://github.com/rust-lang/rust/issues/69343 We *could* strip ` (deleted)` off, but that feels nasty. So instead we save the original binary path, before we do the installation, then restart. Later on, we can also change this to be a _new_ binary path returned by the installers, which we then have to start. Release Notes: - N/A
This commit is contained in:
parent
d2cec0221b
commit
dbebb40956
10 changed files with 49 additions and 25 deletions
|
@ -281,11 +281,14 @@ impl ActivityIndicator {
|
|||
message: "Installing Zed update…".to_string(),
|
||||
on_click: None,
|
||||
},
|
||||
AutoUpdateStatus::Updated => Content {
|
||||
AutoUpdateStatus::Updated { binary_path } => Content {
|
||||
icon: None,
|
||||
message: "Click to restart and update Zed".to_string(),
|
||||
on_click: Some(Arc::new(|_, cx| {
|
||||
workspace::restart(&Default::default(), cx)
|
||||
on_click: Some(Arc::new({
|
||||
let restart = workspace::Restart {
|
||||
binary_path: Some(binary_path.clone()),
|
||||
};
|
||||
move |_, cx| workspace::restart(&restart, cx)
|
||||
})),
|
||||
},
|
||||
AutoUpdateStatus::Errored => Content {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue