aboutsummaryrefslogtreecommitdiff
path: root/src-tauri
diff options
context:
space:
mode:
Diffstat (limited to 'src-tauri')
-rw-r--r--src-tauri/src/main.rs18
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())
+ }
+ }
+}