From 57ab6addda10a49c18dc09208dfb319c0205e869 Mon Sep 17 00:00:00 2001 From: fxqnlr Date: Thu, 26 Jan 2023 17:23:06 +0100 Subject: Todos; fixed input with "-" --- src/commands/modification.rs | 4 +++- src/commands/update.rs | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src/commands') diff --git a/src/commands/modification.rs b/src/commands/modification.rs index 6a03b35..c194202 100644 --- a/src/commands/modification.rs +++ b/src/commands/modification.rs @@ -20,6 +20,7 @@ async fn add(config: Cfg, input: Input) -> MLE<()> { pub async fn mod_add(config: Cfg, mod_id: Vec, list: List, disable_download: bool) -> MLE<()> { + //Fix printing (its horrible) println!("Adding mod(s) {:?}", mod_id); let projects = if mod_id.len() == 1 { vec![project(String::from(&config.apis.modrinth), &mod_id[0]).await] @@ -87,7 +88,8 @@ pub async fn mod_add(config: Cfg, mod_id: Vec, list: List, disable_downl } fn remove(config: Cfg, input: Input) -> MLE<()> { - + + //TODO inplement deletion by slug or title let mod_id = mods_get_id(config.clone(), input.clone().mod_id.unwrap())?; let version = userlist_get_current_version(config.clone(), input.clone().list.unwrap().id, String::from(&mod_id))?; diff --git a/src/commands/update.rs b/src/commands/update.rs index f8bdb82..f71f537 100644 --- a/src/commands/update.rs +++ b/src/commands/update.rs @@ -139,6 +139,7 @@ async fn download_updates_test() { use crate::{modrinth::{Version, VersionFile, Hash, VersionType}, Modloader, List}; + let config = Cfg::init("modlist.toml").unwrap(); let current_list = List { id: String::from("..."), mc_version: String::from("..."), modloader: Modloader::Forge, download_folder: String::from("./dl") }; let versions = vec![Version { @@ -171,5 +172,5 @@ async fn download_updates_test() { "fabric".to_string() ] }]; - assert!(download_versions(current_list, versions).await.is_ok()) + assert!(download_versions(current_list, config, versions).await.is_ok()) } -- cgit v1.2.3