diff options
author | GeckoEidechse <gecko.eidechse+git@pm.me> | 2022-09-10 17:11:18 +0200 |
---|---|---|
committer | GeckoEidechse <gecko.eidechse+git@pm.me> | 2022-09-10 17:11:18 +0200 |
commit | 728f3c81320af6c97bd4217def4fdc5a0f1761d3 (patch) | |
tree | 8212ca8b57ba6e5be7ef065e64dba968def00562 /src-tauri | |
parent | e9d4a9b3834cda6f1c417da322d21beca5f045a4 (diff) | |
download | FlightCore-728f3c81320af6c97bd4217def4fdc5a0f1761d3.tar.gz FlightCore-728f3c81320af6c97bd4217def4fdc5a0f1761d3.zip |
Add update functionality
Diffstat (limited to 'src-tauri')
-rw-r--r-- | src-tauri/src/main.rs | 18 |
1 files changed, 17 insertions, 1 deletions
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<bool, String> { } } } + +#[tauri::command] +/// Update Northstar install in the given path +async fn update_northstar_caller(game_path: String) -> Result<bool, String> { + 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()) + } + } +} |