Make the update checker work for non-mods (#3088)

* Fix https://github.com/modrinth/code/issues/1057

* Make sure mods use the installed loader

* Switch &PathBuf to &Path

* Clippy fix

* Deduplicate some code

---------

Co-authored-by: Jai Agrawal <18202329+Geometrically@users.noreply.github.com>
This commit is contained in:
Josiah Glosson
2024-12-28 21:23:27 -06:00
committed by GitHub
parent 8b7547ae38
commit 01fe08f079
4 changed files with 80 additions and 41 deletions

View File

@@ -13,13 +13,13 @@ use crate::util::io;
use crate::{profile, State};
use async_zip::base::read::seek::ZipFileReader;
use std::io::Cursor;
use std::path::{Component, PathBuf};
use super::install_from::{
generate_pack_from_file, generate_pack_from_version_id, CreatePack,
CreatePackLocation, PackFormat,
};
use crate::data::ProjectType;
use std::io::Cursor;
use std::path::{Component, PathBuf};
/// Install a pack
/// Wrapper around install_pack_files that generates a pack creation description, and
@@ -189,6 +189,7 @@ pub async fn install_zipped_mrpack_files(
.hashes
.get(&PackFileHash::Sha1)
.map(|x| &**x),
ProjectType::get_from_parent_folder(&path),
&state.pool,
)
.await?;
@@ -247,6 +248,7 @@ pub async fn install_zipped_mrpack_files(
&profile_path,
&new_path.to_string_lossy(),
None,
ProjectType::get_from_parent_folder(&new_path),
&state.pool,
)
.await?;