diff options
author | GeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com> | 2023-05-09 23:32:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-09 23:32:37 +0200 |
commit | 1ce900ca2d5cf91ae410c2ec918e1431aa15a677 (patch) | |
tree | 56f06a83fd9b86c3500f74b4d42ae57e4a008f39 /src-tauri/src/lib.rs | |
parent | dce4c5a3768f41eff6be2632c2c21fb5dccb953f (diff) | |
download | FlightCore-1ce900ca2d5cf91ae410c2ec918e1431aa15a677.tar.gz FlightCore-1ce900ca2d5cf91ae410c2ec918e1431aa15a677.zip |
refactor: Move `check_is_valid_game_path` to `main.rs` (#335)
Part of #329
Diffstat (limited to 'src-tauri/src/lib.rs')
-rw-r--r-- | src-tauri/src/lib.rs | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index e22801c5..d4b9349f 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -141,19 +141,6 @@ pub fn find_game_install_location() -> Result<GameInstall, String> { Err("Could not auto-detect game install location! Please enter it manually.".to_string()) } -/// Checks whether the provided path is a valid Titanfall2 gamepath by checking against a certain set of criteria -pub fn check_is_valid_game_path(game_install_path: &str) -> Result<(), String> { - let path_to_titanfall2_exe = format!("{game_install_path}/Titanfall2.exe"); - let is_correct_game_path = std::path::Path::new(&path_to_titanfall2_exe).exists(); - log::info!("Titanfall2.exe exists in path? {}", is_correct_game_path); - - // Exit early if wrong game path - if !is_correct_game_path { - return Err(format!("Incorrect game path \"{game_install_path}\"")); // Return error cause wrong game path - } - Ok(()) -} - /// Copied from `papa` source code and modified ///Extract N* zip file to target game path // fn extract(ctx: &Ctx, zip_file: File, target: &Path) -> Result<()> { |