From 6d0d813c9af9fb43e2732652c5ec14d914dcea42 Mon Sep 17 00:00:00 2001 From: GeckoEidechse Date: Tue, 18 Jul 2023 14:16:18 +0200 Subject: feat: Initial support for installing packages --- src-tauri/src/mod_management/mod.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src-tauri/src/mod_management/mod.rs') 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) => { -- cgit v1.2.3