Skip to content

Commit a158c4e

Browse files
committed
fix quitting on autoupdate
1 parent 14cef73 commit a158c4e

2 files changed

Lines changed: 0 additions & 23 deletions

File tree

src/app/tile/update.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ use crate::app::menubar::menu_icon;
3232
use crate::app::tile::AppIndex;
3333
use crate::app::{Message, Page, tile::Tile};
3434
use crate::autoupdate::download_latest_app;
35-
use crate::autoupdate::relaunch_app;
3635
use crate::calculator::Expr;
3736
use crate::commands::Function;
3837
use crate::config::Config;
@@ -154,7 +153,6 @@ pub fn handle_update(tile: &mut Tile, message: Message) -> Task<Message> {
154153
if tile.config.auto_update {
155154
thread::spawn(|| {
156155
download_latest_app().ok();
157-
relaunch_app();
158156
});
159157
}
160158
Task::done(Message::ReloadConfig)

src/autoupdate.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -188,27 +188,6 @@ fn copy_dir_recursive(src: &std::path::Path, dst: &std::path::Path) -> std::io::
188188
Ok(())
189189
}
190190

191-
pub fn relaunch_app() {
192-
let app_path = match get_app_path() {
193-
Some(p) => p,
194-
None => {
195-
error!("Could not determine current app path for relaunch");
196-
return;
197-
}
198-
};
199-
200-
match std::process::Command::new("open").arg(&app_path).spawn() {
201-
Ok(_) => {
202-
info!("Relaunching app at {:?}", app_path);
203-
std::thread::sleep(std::time::Duration::from_millis(500));
204-
std::process::exit(0);
205-
}
206-
Err(e) => {
207-
error!("Could not relaunch app: {e}");
208-
}
209-
}
210-
}
211-
212191
pub fn get_app_path() -> Option<std::path::PathBuf> {
213192
let exe = std::env::current_exe().ok()?;
214193

0 commit comments

Comments
 (0)