mirror of
https://github.com/modrinth/code.git
synced 2026-08-31 12:05:53 +00:00
fix: dont treat rp folder inside config as rp
This commit is contained in:
@@ -43,6 +43,13 @@ type ExtractProgressFn<'a> = dyn FnMut(u64) -> Pin<Box<dyn Future<Output = crate
|
|||||||
+ 'a;
|
+ 'a;
|
||||||
const MODPACK_CONTENT_DOWNLOAD_CONCURRENCY: usize = 4;
|
const MODPACK_CONTENT_DOWNLOAD_CONCURRENCY: usize = 4;
|
||||||
|
|
||||||
|
fn is_override_content_file(path: &str) -> bool {
|
||||||
|
Path::new(path)
|
||||||
|
.parent()
|
||||||
|
.is_some_and(|parent| parent.components().count() == 1)
|
||||||
|
&& ProjectType::get_from_parent_folder(path).is_some()
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
struct ModpackContentInstallContext {
|
struct ModpackContentInstallContext {
|
||||||
instance_id: String,
|
instance_id: String,
|
||||||
@@ -274,9 +281,7 @@ pub(crate) async fn get_external_files_from_mrpack(
|
|||||||
let relative_path = path
|
let relative_path = path
|
||||||
.strip_prefix("overrides/")
|
.strip_prefix("overrides/")
|
||||||
.or_else(|| path.strip_prefix("client-overrides/"))?;
|
.or_else(|| path.strip_prefix("client-overrides/"))?;
|
||||||
if path.ends_with('/')
|
if path.ends_with('/') || !is_override_content_file(relative_path) {
|
||||||
|| ProjectType::get_from_parent_folder(relative_path).is_none()
|
|
||||||
{
|
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
let file_name = relative_path.rsplit('/').next()?.to_string();
|
let file_name = relative_path.rsplit('/').next()?.to_string();
|
||||||
|
|||||||
Reference in New Issue
Block a user