Skip to content

Commit

Permalink
refactor: Move clean_up_download_folder_wrapper (#628)
Browse files Browse the repository at this point in the history
to `repair_and_verify` module
  • Loading branch information
GeckoEidechse authored Oct 13, 2023
1 parent fbaa5d7 commit 1b656b8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
16 changes: 1 addition & 15 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ fn main() {
platform_specific::linux_checks,
mod_management::get_installed_mods_and_properties,
mod_management::install_mod_wrapper,
clean_up_download_folder_wrapper,
repair_and_verify::clean_up_download_folder_wrapper,
github::release_notes::get_newest_flightcore_version,
mod_management::delete_northstar_mod,
util::get_server_player_count,
Expand Down Expand Up @@ -202,20 +202,6 @@ pub fn convert_release_candidate_number(version_number: String) -> String {
version_number.replace("-rc", "0").replace("00", "")
}

/// Installs the specified mod
#[tauri::command]
async fn clean_up_download_folder_wrapper(
game_install: GameInstall,
force: bool,
) -> Result<(), String> {
match repair_and_verify::clean_up_download_folder(&game_install, force) {
Ok(()) => Ok(()),
Err(err) => Err(err.to_string()),
}
}

use anyhow::Result;

/// Defines how Titanfall2 was installed (Steam, Origin, ...)
#[derive(Serialize, Deserialize, Debug, Clone, TS)]
#[ts(export)]
Expand Down
12 changes: 12 additions & 0 deletions src-tauri/src/repair_and_verify/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,18 @@ pub fn disable_all_but_core(game_install: GameInstall) -> Result<(), String> {
Ok(())
}

/// Installs the specified mod
#[tauri::command]
pub async fn clean_up_download_folder_wrapper(
game_install: GameInstall,
force: bool,
) -> Result<(), String> {
match clean_up_download_folder(&game_install, force) {
Ok(()) => Ok(()),
Err(err) => Err(err.to_string()),
}
}

/// Deletes download folder
/// If `force` is FALSE, bails on non-empty folder
/// If `force` is TRUE, deletes folder even if non-empty
Expand Down

0 comments on commit 1b656b8

Please sign in to comment.