aboutsummaryrefslogtreecommitdiff
path: root/src-tauri/src/mod_management
diff options
context:
space:
mode:
Diffstat (limited to 'src-tauri/src/mod_management')
-rw-r--r--src-tauri/src/mod_management/mod.rs18
1 files changed, 14 insertions, 4 deletions
diff --git a/src-tauri/src/mod_management/mod.rs b/src-tauri/src/mod_management/mod.rs
index 5d745f64..d1cc366e 100644
--- a/src-tauri/src/mod_management/mod.rs
+++ b/src-tauri/src/mod_management/mod.rs
@@ -427,9 +427,19 @@ pub async fn fc_download_mod_and_install(
);
// Download the mod
- let temp_file = match thermite::core::manage::download_file(download_url, &path) {
- Ok(f) => TempFile::new(f, path.into()),
- Err(e) => return Err(e.to_string()),
+ let temp_file = TempFile::new(
+ std::fs::File::options()
+ .read(true)
+ .write(true)
+ .truncate(true)
+ .create(true)
+ .open(&path)
+ .map_err(|e| e.to_string())?,
+ (&path).into(),
+ );
+ match thermite::core::manage::download(temp_file.file(), download_url) {
+ Ok(_written_bytes) => (),
+ Err(err) => return Err(err.to_string()),
};
// Get Thunderstore mod author
@@ -441,7 +451,7 @@ pub async fn fc_download_mod_and_install(
temp_file.file(),
std::path::Path::new(&mods_directory),
) {
- Ok(()) => (),
+ Ok(_) => (),
Err(err) => {
log::warn!("libthermite couldn't install mod {thunderstore_mod_string} due to {err:?}",);
return Err(err.to_string());