aboutsummaryrefslogtreecommitdiff
path: root/src-tauri/src/northstar
diff options
context:
space:
mode:
authorGeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com>2023-07-30 02:11:28 +0200
committerGitHub <noreply@github.com>2023-07-30 02:11:28 +0200
commit14fdc631291a117b8a137b6fbbebfe3dea3a8697 (patch)
treebfe550ad295194dc0de779080a4e495dcf683161 /src-tauri/src/northstar
parent40520344778a98c45817e9cbc00caab6ec3ea6bf (diff)
downloadFlightCore-14fdc631291a117b8a137b6fbbebfe3dea3a8697.tar.gz
FlightCore-14fdc631291a117b8a137b6fbbebfe3dea3a8697.zip
refactor: Replace naive `game_path` argument with `GameInstall` (#454)
We should always pass the whole object instead of just a field for easier expandability in the future Co-authored-by: Jan200101 <sentrycraft123@gmail.com>
Diffstat (limited to 'src-tauri/src/northstar')
-rw-r--r--src-tauri/src/northstar/mod.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src-tauri/src/northstar/mod.rs b/src-tauri/src/northstar/mod.rs
index 85d792d6..173495c6 100644
--- a/src-tauri/src/northstar/mod.rs
+++ b/src-tauri/src/northstar/mod.rs
@@ -26,15 +26,14 @@ pub fn check_mod_version_number(path_to_mod_folder: &str) -> Result<String, anyh
/// Returns the current Northstar version number as a string
#[tauri::command]
-pub fn get_northstar_version_number(game_path: &str) -> Result<String, String> {
- log::info!("{}", game_path);
+pub fn get_northstar_version_number(game_install: GameInstall) -> Result<String, String> {
+ log::info!("{}", game_install.game_path);
// TODO:
// Check if NorthstarLauncher.exe exists and check its version number
- let profile_folder = "R2Northstar";
let initial_version_number = match check_mod_version_number(&format!(
- "{game_path}/{profile_folder}/mods/{}",
- CORE_MODS[0]
+ "{}/{}/mods/{}",
+ game_install.game_path, game_install.profile, CORE_MODS[0]
)) {
Ok(version_number) => version_number,
Err(err) => return Err(err.to_string()),
@@ -42,7 +41,8 @@ pub fn get_northstar_version_number(game_path: &str) -> Result<String, String> {
for core_mod in CORE_MODS {
let current_version_number = match check_mod_version_number(&format!(
- "{game_path}/{profile_folder}/mods/{core_mod}",
+ "{}/{}/mods/{}",
+ game_install.game_path, game_install.profile, core_mod
)) {
Ok(version_number) => version_number,
Err(err) => return Err(err.to_string()),
@@ -85,7 +85,7 @@ pub fn launch_northstar(
// Only check guards if bypassing checks is not enabled
if !bypass_checks {
// Some safety checks before, should have more in the future
- if get_northstar_version_number(&game_install.game_path).is_err() {
+ if get_northstar_version_number(game_install.clone()).is_err() {
return Err(anyhow!("Not all checks were met").to_string());
}