usestd::fs;uselog::warn;usecrate::{api::model::LocalIndex,core::Ctx};useanyhow::Result;pub(crate)fnexclude(ctx:&Ctx, mods:Vec<String>)->Result<()>{letmut local =LocalIndex::load(&ctx.local_target)?;for m in mods {ifletSome(g)= local
.linked
.clone()
.iter()
.find(|(n, _)|n.trim().to_lowercase()== m.trim().to_lowercase()){for m in g.1.mods.iter(){fs::remove_dir_all(ctx.local_target.join(&m.name))?;}println!("Removed link to {}", m);
local.linked.remove(g.0);}else{warn!("Coudln't find link to {} in directory {}",
m,
ctx.local_target.display());println!("No mod '{}' linked to current mod directory", m);}}Ok(())}