diff options
author | GeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com> | 2022-12-12 08:04:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-12 08:04:50 +0100 |
commit | e768d9ffab874d5991336464c80eb3b9e5a28b0c (patch) | |
tree | 274828369815e7bf3b9f2cf5030ab0d2f1e2528e /src-tauri/src/repair_and_verify | |
parent | 540ff5f6685315fdf91b5c2c5924c97c3e346a65 (diff) | |
download | FlightCore-e768d9ffab874d5991336464c80eb3b9e5a28b0c.tar.gz FlightCore-e768d9ffab874d5991336464c80eb3b9e5a28b0c.zip |
fix: Make sure all non-core mods get disabled (#103)
For this we first rebuild the `enabledmods.json` file. This ensures that
all installed mods are actually listed there.
The function was originally created before we could rebuild
`enabledmods.json` by checking installed mods.
Diffstat (limited to 'src-tauri/src/repair_and_verify')
-rw-r--r-- | src-tauri/src/repair_and_verify/mod.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src-tauri/src/repair_and_verify/mod.rs b/src-tauri/src/repair_and_verify/mod.rs index 3d5fdc04..64278a25 100644 --- a/src-tauri/src/repair_and_verify/mod.rs +++ b/src-tauri/src/repair_and_verify/mod.rs @@ -1,4 +1,4 @@ -use crate::{mod_management::set_mod_enabled_status, northstar::CORE_MODS}; +use crate::{mod_management::{set_mod_enabled_status, rebuild_enabled_mods_json}, northstar::CORE_MODS}; use anyhow::anyhow; /// Contains various functions to repair common issues and verifying installation use app::{get_enabled_mods, GameInstall}; @@ -12,6 +12,10 @@ pub fn verify_game_files(game_install: GameInstall) -> Result<String, String> { /// Disables all mods except core ones /// Enables core mods if disabled pub fn disable_all_but_core(game_install: GameInstall) -> Result<(), String> { + + // Rebuild `enabledmods.json` first to ensure all mods are added + rebuild_enabled_mods_json(game_install.clone())?; + let current_mods = get_enabled_mods(game_install.clone())?; // Disable all mods, set core mods to enabled |