diff options
author | Rémy Raes <contact@remyraes.com> | 2022-09-24 19:01:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-24 19:01:33 +0200 |
commit | 5bf2254204692066fbd5774097b1e3fbc33d0157 (patch) | |
tree | 73652a5b6b0245aa81a9ce30451165207ac868f5 /src-tauri/src/main.rs | |
parent | bdba63fa033a9f98d63951ec0cf9109f7949f444 (diff) | |
parent | 94979acb5d62fc5a0498b8d0170308511972fbb7 (diff) | |
download | FlightCore-5bf2254204692066fbd5774097b1e3fbc33d0157.tar.gz FlightCore-5bf2254204692066fbd5774097b1e3fbc33d0157.zip |
Merge branch 'GeckoEidechse:main' into feat/new-ui
Diffstat (limited to 'src-tauri/src/main.rs')
-rw-r--r-- | src-tauri/src/main.rs | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 536acbe5..025b6863 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -15,6 +15,10 @@ use app::{ get_host_os, get_log_list, get_northstar_version_number, install_northstar, launch_northstar, GameInstall, }; + +mod repair_and_verify; +use repair_and_verify::verify_game_files; + use tauri::Manager; use tokio::time::sleep; use tauri_plugin_store::PluginBuilder; @@ -78,7 +82,8 @@ fn main() { update_northstar_caller, launch_northstar_caller, check_is_flightcore_outdated_caller, - get_log_list_caller + get_log_list_caller, + verify_game_files_caller ]) .run(tauri::generate_context!()) .expect("error while running tauri application"); @@ -106,7 +111,13 @@ fn force_panic() { /// Returns the current version number as a string fn get_version_number() -> String { let version = env!("CARGO_PKG_VERSION"); - format!("v{}", version) + if cfg!(debug_assertions) { + // Debugging enabled + format!("v{} (debug mode)", version) + } else { + // Debugging disabled + format!("v{}", version) + } } #[tauri::command] @@ -240,3 +251,8 @@ fn launch_northstar_caller(game_install: GameInstall) -> Result<String, String> fn get_log_list_caller(game_install: GameInstall) -> Result<Vec<std::path::PathBuf>, String> { get_log_list(game_install) } + +#[tauri::command] +fn verify_game_files_caller(game_install: GameInstall) -> Result<String, String> { + verify_game_files(game_install) +} |