diff options
author | GeckoEidechse <gecko.eidechse+git@pm.me> | 2023-07-18 14:16:18 +0200 |
---|---|---|
committer | GeckoEidechse <gecko.eidechse+git@pm.me> | 2023-07-18 14:16:18 +0200 |
commit | 6d0d813c9af9fb43e2732652c5ec14d914dcea42 (patch) | |
tree | 7c544d516ede038750f696bc9eec66de70e5867d /src-tauri/src/mod_management/mod.rs | |
parent | dfa5af1746546d388a85081fae499c28521a20ea (diff) | |
download | FlightCore-6d0d813c9af9fb43e2732652c5ec14d914dcea42.tar.gz FlightCore-6d0d813c9af9fb43e2732652c5ec14d914dcea42.zip |
feat: Initial support for installing packages
Diffstat (limited to 'src-tauri/src/mod_management/mod.rs')
-rw-r--r-- | src-tauri/src/mod_management/mod.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src-tauri/src/mod_management/mod.rs b/src-tauri/src/mod_management/mod.rs index 825cba37..adc46661 100644 --- a/src-tauri/src/mod_management/mod.rs +++ b/src-tauri/src/mod_management/mod.rs @@ -285,7 +285,6 @@ pub async fn fc_download_mod_and_install( "{}/___flightcore-temp-download-dir/", game_install.game_path ); - let mods_directory = format!("{}/R2Northstar/mods/", game_install.game_path); // Early return on empty string if thunderstore_mod_string.is_empty() { @@ -350,14 +349,16 @@ pub async fn fc_download_mod_and_install( Err(err) => return Err(err.to_string()), }; - // Get Thunderstore mod author - let author = thunderstore_mod_string.split('-').next().unwrap(); + // Get directory to install to made up of packages directory and Thunderstore mod string + let install_directory = format!( + "{}/R2Northstar/packages/{}", + game_install.game_path, thunderstore_mod_string + ); // Extract the mod to the mods directory match thermite::core::manage::install_mod( - author, temp_file.file(), - std::path::Path::new(&mods_directory), + std::path::Path::new(&install_directory), ) { Ok(_) => (), Err(err) => { |