changed the way files get resolved on mod install

to better handle fomod and it's required interactivity
This commit is contained in:
2026-03-30 22:07:46 +02:00
parent 7e20cd370c
commit bdeebfee4f
6 changed files with 126 additions and 63 deletions

View File

@@ -20,7 +20,12 @@ fn add_plain() -> Result<(), Box<dyn Error>> {
let mod_to_install = root_config
.mod_by_id("add_test_plain")
.expect("Mod not found");
let files_to_add = resolve_files_for_install(&root_config, &instance, &mod_to_install)?;
let files_to_add = match resolve_files_for_install(&root_config, &mod_to_install)? {
fomod_manager::actions::ResolveFileResult::Files(mod_files) => mod_files,
_ => {
panic!("Resolved files have wrong type");
}
};
insert_mod_to_instance(&mut instance, &mod_to_install, &files_to_add, 0);
@@ -53,7 +58,12 @@ fn add_nested() -> Result<(), Box<dyn Error>> {
let mod_to_install = root_config
.mod_by_id("add_test_nested")
.expect("Mod not found");
let files_to_add = resolve_files_for_install(&root_config, &instance, &mod_to_install)?;
let files_to_add = match resolve_files_for_install(&root_config, &mod_to_install)? {
fomod_manager::actions::ResolveFileResult::Files(mod_files) => mod_files,
_ => {
panic!("Resolved files have wrong type");
}
};
insert_mod_to_instance(&mut instance, &mod_to_install, &files_to_add, 0);
@@ -86,7 +96,12 @@ fn add_root() -> Result<(), Box<dyn Error>> {
let mod_to_install = root_config
.mod_by_id("add_test_root")
.expect("Mod not found");
let files_to_add = resolve_files_for_install(&root_config, &instance, &mod_to_install)?;
let files_to_add = match resolve_files_for_install(&root_config, &mod_to_install)? {
fomod_manager::actions::ResolveFileResult::Files(mod_files) => mod_files,
_ => {
panic!("Resolved files have wrong type");
}
};
insert_mod_to_instance(&mut instance, &mod_to_install, &files_to_add, 0);
@@ -117,7 +132,12 @@ fn add_filter() -> Result<(), Box<dyn Error>> {
let mod_to_install = root_config
.mod_by_id("add_test_filter")
.expect("Mod not found");
let files_to_add = resolve_files_for_install(&root_config, &instance, &mod_to_install)?;
let files_to_add = match resolve_files_for_install(&root_config, &mod_to_install)? {
fomod_manager::actions::ResolveFileResult::Files(mod_files) => mod_files,
_ => {
panic!("Resolved files have wrong type");
}
};
insert_mod_to_instance(&mut instance, &mod_to_install, &files_to_add, 0);