From 2758f40b8f31c9684f0ae6c6fc6fc2e06c7c62ee Mon Sep 17 00:00:00 2001 From: Warren Hood Date: Mon, 19 Aug 2024 00:38:30 +0200 Subject: [PATCH] Added an update command --- src/main.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main.rs b/src/main.rs index fd2ec2e..b0d0ec9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -83,6 +83,11 @@ enum Commands { #[arg(long, short, default_value_t = DownloadSide::Both)] side: DownloadSide, }, + Update { + /// Use exact transitive mod dependency versions + #[arg(long, short, action)] + locked: bool, + } } #[tokio::main(flavor = "multi_thread")] @@ -246,6 +251,12 @@ async fn main() -> Result<(), Box> { pack_lock.download_mods(&mods_dir, side).await?; println!("Mods updated"); } + Commands::Update { locked } => { + let mut pack_lock = resolver::PinnedPackMeta::new(); + let modpack_meta = ModpackMeta::load_from_current_directory()?; + pack_lock.init(&modpack_meta, !locked).await?; + pack_lock.save_current_dir_lock()?; + } } };