aboutsummaryrefslogtreecommitdiff
path: root/src-tauri/src/northstar
diff options
context:
space:
mode:
Diffstat (limited to 'src-tauri/src/northstar')
-rw-r--r--src-tauri/src/northstar/install.rs1
-rw-r--r--src-tauri/src/northstar/mod.rs13
2 files changed, 9 insertions, 5 deletions
diff --git a/src-tauri/src/northstar/install.rs b/src-tauri/src/northstar/install.rs
index c01148a1..235c35ff 100644
--- a/src-tauri/src/northstar/install.rs
+++ b/src-tauri/src/northstar/install.rs
@@ -148,6 +148,7 @@ pub async fn install_northstar(
}
/// Attempts to find the game install location
+#[tauri::command]
pub fn find_game_install_location() -> Result<GameInstall, String> {
// Attempt parsing Steam library directly
match steamlocate::SteamDir::locate() {
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());