Compare commits
No commits in common. "91b20693fd6bf009c6a184abd55888a30a103339" and "ea766de5c31c2217db74222689cf8ebd875626e7" have entirely different histories.
91b20693fd
...
ea766de5c3
4 changed files with 1 additions and 68 deletions
|
|
@ -40,11 +40,6 @@ impl Install {
|
||||||
let client = reqwest::Client::new();
|
let client = reqwest::Client::new();
|
||||||
|
|
||||||
for mod_name in &self.mods {
|
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 url = format!("{}/project/{}/version", Self::BASE_URL, mod_name);
|
||||||
|
|
||||||
let params = InstallQueryParams {
|
let params = InstallQueryParams {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
pub mod create;
|
pub mod create;
|
||||||
pub mod install;
|
pub mod install;
|
||||||
pub mod search;
|
pub mod search;
|
||||||
pub mod update;
|
|
||||||
|
|
|
||||||
|
|
@ -1,28 +0,0 @@
|
||||||
use std::error::Error;
|
|
||||||
|
|
||||||
pub struct Update {
|
|
||||||
mods_only: bool,
|
|
||||||
loader_only: bool,
|
|
||||||
loader_version: Option<String>,
|
|
||||||
version: Option<String>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Update {
|
|
||||||
pub fn new(
|
|
||||||
mods_only: bool,
|
|
||||||
loader_only: bool,
|
|
||||||
loader_version: Option<String>,
|
|
||||||
version: Option<String>,
|
|
||||||
) -> Self {
|
|
||||||
Self {
|
|
||||||
mods_only,
|
|
||||||
loader_only,
|
|
||||||
loader_version,
|
|
||||||
version,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub async fn run(&self) -> Result<(), Box<dyn Error>> {
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
35
src/main.rs
35
src/main.rs
|
|
@ -2,7 +2,7 @@ mod commands;
|
||||||
mod models;
|
mod models;
|
||||||
mod utils;
|
mod utils;
|
||||||
|
|
||||||
use crate::commands::{create::Create, install::Install, search::Search, update::Update};
|
use crate::commands::{create::Create, install::Install, search::Search};
|
||||||
use clap::{
|
use clap::{
|
||||||
Parser, Subcommand,
|
Parser, Subcommand,
|
||||||
builder::styling::{self},
|
builder::styling::{self},
|
||||||
|
|
@ -75,25 +75,6 @@ enum Commands {
|
||||||
#[arg(trailing_var_arg = true)]
|
#[arg(trailing_var_arg = true)]
|
||||||
mods: Vec<String>,
|
mods: Vec<String>,
|
||||||
},
|
},
|
||||||
|
|
||||||
/// 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<String>,
|
|
||||||
|
|
||||||
/// Specify minecraft version to update to
|
|
||||||
#[arg(long, conflicts_with = "loader_only")]
|
|
||||||
version: Option<String>,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
|
|
@ -139,20 +120,6 @@ async fn main() -> Result<(), Box<dyn Error>> {
|
||||||
let install = Install::new(mods);
|
let install = Install::new(mods);
|
||||||
install.run().await?;
|
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(())
|
Ok(())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue