aboutsummaryrefslogtreecommitdiff
path: root/src-tauri/src/northstar/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src-tauri/src/northstar/mod.rs')
-rw-r--r--src-tauri/src/northstar/mod.rs13
1 files changed, 8 insertions, 5 deletions
diff --git a/src-tauri/src/northstar/mod.rs b/src-tauri/src/northstar/mod.rs
index f210faab..7477f6aa 100644
--- a/src-tauri/src/northstar/mod.rs
+++ b/src-tauri/src/northstar/mod.rs
@@ -22,7 +22,8 @@ pub fn check_mod_version_number(path_to_mod_folder: &str) -> Result<String, anyh
}
/// Returns the current Northstar version number as a string
-pub fn get_northstar_version_number(game_path: &str) -> Result<String, anyhow::Error> {
+#[tauri::command]
+pub fn get_northstar_version_number(game_path: &str) -> Result<String, String> {
log::info!("{}", game_path);
// TODO:
@@ -33,7 +34,7 @@ pub fn get_northstar_version_number(game_path: &str) -> Result<String, anyhow::E
CORE_MODS[0]
)) {
Ok(version_number) => version_number,
- Err(err) => return Err(err),
+ Err(err) => return Err(err.to_string()),
};
for core_mod in CORE_MODS {
@@ -41,11 +42,11 @@ pub fn get_northstar_version_number(game_path: &str) -> Result<String, anyhow::E
"{game_path}/{profile_folder}/mods/{core_mod}",
)) {
Ok(version_number) => version_number,
- Err(err) => return Err(err),
+ Err(err) => return Err(err.to_string()),
};
if current_version_number != initial_version_number {
// We have a version number mismatch
- return Err(anyhow!("Found version number mismatch"));
+ return Err("Found version number mismatch".to_string());
}
}
log::info!("All mods same version");
@@ -53,8 +54,10 @@ pub fn get_northstar_version_number(game_path: &str) -> Result<String, anyhow::E
Ok(initial_version_number)
}
+/// Launches Northstar
+#[tauri::command]
pub fn launch_northstar(
- game_install: &GameInstall,
+ game_install: GameInstall,
bypass_checks: Option<bool>,
) -> Result<String, String> {
dbg!(game_install.clone());