From 728f3c81320af6c97bd4217def4fdc5a0f1761d3 Mon Sep 17 00:00:00 2001 From: GeckoEidechse Date: Sat, 10 Sep 2022 17:11:18 +0200 Subject: Add update functionality --- src-tauri/src/main.rs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src-tauri/src/main.rs') diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 0b22eaff..bd1aa2d8 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -54,7 +54,8 @@ fn main() { check_is_northstar_outdated, verify_install_location, get_host_os, - install_northstar_caller + install_northstar_caller, + update_northstar_caller ]) .run(tauri::generate_context!()) .expect("error while running tauri application"); @@ -171,3 +172,18 @@ async fn install_northstar_caller(game_path: String) -> Result { } } } + +#[tauri::command] +/// Update Northstar install in the given path +async fn update_northstar_caller(game_path: String) -> Result { + println!("Updating"); + + // Simply re-run install with up-to-date version for upate + match install_northstar(&game_path).await { + Ok(_) => Ok(true), + Err(err) => { + println!("{}", err); + Err(err.to_string()) + } + } +} -- cgit v1.2.3