diff options
author | GeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com> | 2022-12-05 18:09:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-05 18:09:13 +0100 |
commit | efe8e523a9fce1487342c7cfeddd31a26246b74c (patch) | |
tree | 0b836eca87c9c5aac3f06a8bebbd7265f5099496 /src-tauri/src/mod_management/mod.rs | |
parent | d9eeec6a6c46db38c8243760789fe56d6f198b27 (diff) | |
download | FlightCore-efe8e523a9fce1487342c7cfeddd31a26246b74c.tar.gz FlightCore-efe8e523a9fce1487342c7cfeddd31a26246b74c.zip |
refactor: Move variable to global const (#85)
Makes it easier to update/re-use in the future
Co-authored-by: Remy Raes <contact@remyraes.com>
Diffstat (limited to 'src-tauri/src/mod_management/mod.rs')
-rw-r--r-- | src-tauri/src/mod_management/mod.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src-tauri/src/mod_management/mod.rs b/src-tauri/src/mod_management/mod.rs index b8d210ff..b17e98a6 100644 --- a/src-tauri/src/mod_management/mod.rs +++ b/src-tauri/src/mod_management/mod.rs @@ -10,6 +10,12 @@ use app::GameInstall; use json5; +pub const BLACKLISTED_MODS: [&str; 3] = [ + "northstar-Northstar", + "northstar-NorthstarReleaseCandidate", + "ebkr-r2modman", +]; + /// Gets all currently installed and enabled/disabled mods to rebuild `enabledmods.json` pub fn rebuild_enabled_mods_json(game_install: GameInstall) -> Result<(), String> { let enabledmods_json_path = format!("{}/R2Northstar/enabledmods.json", game_install.game_path); @@ -317,12 +323,7 @@ pub async fn fc_download_mod_and_install( // Prevent installing Northstar as a mod // While it would fail during install anyway, having explicit error message is nicer - let blacklisted_mods = [ - "northstar-Northstar", - "northstar-NorthstarReleaseCandidate", - "ebkr-r2modman", - ]; - for blacklisted_mod in blacklisted_mods { + for blacklisted_mod in BLACKLISTED_MODS { if thunderstore_mod_string.contains(blacklisted_mod) { return Err("Cannot install Northstar as a mod!".to_string()); } |