diff options
Diffstat (limited to 'src-tauri')
-rw-r--r-- | src-tauri/src/main.rs | 1 | ||||
-rw-r--r-- | src-tauri/src/repair_and_verify/mod.rs | 35 |
2 files changed, 36 insertions, 0 deletions
diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 09242680..5afa2335 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -130,6 +130,7 @@ fn main() { github::release_notes::check_is_flightcore_outdated, repair_and_verify::get_log_list, repair_and_verify::verify_game_files, + repair_and_verify::delete_remote_mods, mod_management::set_mod_enabled_status, repair_and_verify::disable_all_but_core, util::is_debug_mode, diff --git a/src-tauri/src/repair_and_verify/mod.rs b/src-tauri/src/repair_and_verify/mod.rs index c752a3ab..606998a2 100644 --- a/src-tauri/src/repair_and_verify/mod.rs +++ b/src-tauri/src/repair_and_verify/mod.rs @@ -136,3 +136,38 @@ pub fn get_log_list(game_install: GameInstall) -> Result<Vec<std::path::PathBuf> Err("No logs found".to_string()) } } + +/// TODO +#[tauri::command] +pub fn delete_remote_mods(game_install: GameInstall) -> Result<(), String> { + // Get remote mods folder + let ns_remote_mod_folder = format!( + "{}/{}/runtime/remote/mods/", + game_install.game_path, game_install.profile + ); // TODO double check + + // Safety check + let path_to_delete = std::path::Path::new(&ns_remote_mod_folder); + + // Check if path even exists before we attempt to remove + if !path_to_delete.exists() { + log::info!( + "{} does not exist. Nothing to do here", + ns_remote_mod_folder + ); + return Ok(()); + } + + if !path_to_delete.is_dir() { + let error_message = format!( + "{} exists but is a file? This should never happen", + ns_remote_mod_folder + ); + log::error!("{}", error_message); + return Err(error_message); + } + + // Delete + // TODO + Err("TODO".to_string()) +} |