From 86a46f75625f39c467e9e8f640f845827ea55822 Mon Sep 17 00:00:00 2001 From: RafayAhmad7548 Date: Thu, 3 Sep 2026 16:45:40 +0500 Subject: [PATCH 1/3] feat(install): skip already installed mods in install cmd --- src/commands/install.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/commands/install.rs b/src/commands/install.rs index caa1b74..590ade8 100644 --- a/src/commands/install.rs +++ b/src/commands/install.rs @@ -40,6 +40,11 @@ impl Install { let client = reqwest::Client::new(); for mod_name in &self.mods { + if config.mods.contains_key(mod_name) { + println!("{} mod already installed, skipping...", mod_name); + continue; + } + let url = format!("{}/project/{}/version", Self::BASE_URL, mod_name); let params = InstallQueryParams { From f6d47e4b4d72bf2076290668058bc71698eee613 Mon Sep 17 00:00:00 2001 From: RafayAhmad7548 Date: Thu, 3 Sep 2026 16:58:54 +0500 Subject: [PATCH 2/3] feat(update): add strucutre for update command --- src/commands/mod.rs | 1 + src/commands/update.rs | 28 ++++++++++++++++++++++++++++ src/main.rs | 30 +++++++++++++++++++++++++++++- 3 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 src/commands/update.rs diff --git a/src/commands/mod.rs b/src/commands/mod.rs index 83e620d..51a02d0 100644 --- a/src/commands/mod.rs +++ b/src/commands/mod.rs @@ -1,3 +1,4 @@ pub mod create; pub mod install; pub mod search; +pub mod update; diff --git a/src/commands/update.rs b/src/commands/update.rs new file mode 100644 index 0000000..46576b3 --- /dev/null +++ b/src/commands/update.rs @@ -0,0 +1,28 @@ +use std::error::Error; + +pub struct Update { + mods_only: bool, + loader_only: bool, + loader_version: Option, + version: Option, +} + +impl Update { + pub fn new( + mods_only: bool, + loader_only: bool, + loader_version: Option, + version: Option, + ) -> Self { + Self { + mods_only, + loader_only, + loader_version, + version, + } + } + + pub async fn run(&self) -> Result<(), Box> { + Ok(()) + } +} diff --git a/src/main.rs b/src/main.rs index 6d33756..189cebc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,7 +2,7 @@ mod commands; mod models; mod utils; -use crate::commands::{create::Create, install::Install, search::Search}; +use crate::commands::{create::Create, install::Install, search::Search, update::Update}; use clap::{ Parser, Subcommand, builder::styling::{self}, @@ -75,6 +75,20 @@ enum Commands { #[arg(trailing_var_arg = true)] mods: Vec, }, + + Update { + #[arg(long, conflicts_with_all = ["loader_only", "loader_version"])] + mods_only: bool, + + #[arg(long, conflicts_with_all = ["mods_only", "version"])] + loader_only: bool, + + #[arg(long, conflicts_with = "mods_only")] + loader_version: Option, + + #[arg(long, conflicts_with = "loader_only")] + version: Option, + }, } #[tokio::main] @@ -120,6 +134,20 @@ async fn main() -> Result<(), Box> { let install = Install::new(mods); install.run().await?; } + Commands::Update { + mods_only, + loader_only, + loader_version, + version, + } => { + let update = Update::new( + mods_only, + loader_only, + loader_version, + version, + ); + update.run().await?; + } } Ok(()) From 91b20693fd6bf009c6a184abd55888a30a103339 Mon Sep 17 00:00:00 2001 From: RafayAhmad7548 Date: Thu, 3 Sep 2026 17:11:28 +0500 Subject: [PATCH 3/3] docs(update): add docs for update command --- src/main.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main.rs b/src/main.rs index 189cebc..9d51201 100644 --- a/src/main.rs +++ b/src/main.rs @@ -76,16 +76,21 @@ enum Commands { mods: Vec, }, + /// Update minecraft/mods/loader for project in current directory Update { + /// Only update mods to latest version for current minecraft version #[arg(long, conflicts_with_all = ["loader_only", "loader_version"])] mods_only: bool, + /// Only update mod loader to latest version #[arg(long, conflicts_with_all = ["mods_only", "version"])] loader_only: bool, + /// Specify mod loader version to update to #[arg(long, conflicts_with = "mods_only")] loader_version: Option, + /// Specify minecraft version to update to #[arg(long, conflicts_with = "loader_only")] version: Option, },