diff options
author | fxqnlr <[email protected]> | 2023-05-09 20:34:09 +0200 |
---|---|---|
committer | fxqnlr <[email protected]> | 2023-05-09 20:34:09 +0200 |
commit | 9063a041f6b2e72f6e4a861c77ac16065dd5378b (patch) | |
tree | 03d34dfe9ff05de2dd74d3afe1cde87712f1b59a /src/commands/update.rs | |
parent | 0c7ba29d3e17c47e5fc9cffe78c28a0019d453b7 (diff) | |
download | modlist-9063a041f6b2e72f6e4a861c77ac16065dd5378b.tar modlist-9063a041f6b2e72f6e4a861c77ac16065dd5378b.tar.gz modlist-9063a041f6b2e72f6e4a861c77ac16065dd5378b.zip |
add list toggles to update and download;
add mod remove output and fix errors
Diffstat (limited to 'src/commands/update.rs')
-rw-r--r-- | src/commands/update.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/commands/update.rs b/src/commands/update.rs index 4bc3ac0..d76ba4b 100644 --- a/src/commands/update.rs +++ b/src/commands/update.rs | |||
@@ -18,19 +18,19 @@ pub async fn update( | |||
18 | delete_old: bool, | 18 | delete_old: bool, |
19 | ) -> MLE<()> { | 19 | ) -> MLE<()> { |
20 | for current_list in liststack { | 20 | for current_list in liststack { |
21 | println!("Update mods in {}", current_list.id); | ||
21 | let mods = userlist_get_all_ids(config.clone(), current_list.clone().id)?; | 22 | let mods = userlist_get_all_ids(config.clone(), current_list.clone().id)?; |
22 | 23 | ||
23 | let mut current_versions: Vec<(String, String)> = vec![]; | 24 | let mut current_versions: Vec<(String, String)> = vec![]; |
24 | 25 | ||
25 | println!(" └Update mods:"); | ||
26 | let mut updatestack: Vec<Version> = vec![]; | 26 | let mut updatestack: Vec<Version> = vec![]; |
27 | 27 | ||
28 | for id in mods { | 28 | for id in mods { |
29 | let info = mods_get_info(config.clone(), &id)?; | 29 | let info = mods_get_info(config.clone(), &id)?; |
30 | println!("\t└{}", info.title); | 30 | println!(" └{}", info.title); |
31 | 31 | ||
32 | if userlist_get_set_version(config.clone(), ¤t_list.id, &id)? { | 32 | if userlist_get_set_version(config.clone(), ¤t_list.id, &id)? { |
33 | println!("\t └Set version, skipping update"); | 33 | println!(" └Set version, skipping update"); |
34 | continue; | 34 | continue; |
35 | } | 35 | } |
36 | 36 | ||
@@ -54,7 +54,7 @@ pub async fn update( | |||
54 | Err(e) => { | 54 | Err(e) => { |
55 | if e.to_string() == "Mod: NO_UPDATE_AVAILABLE" { | 55 | if e.to_string() == "Mod: NO_UPDATE_AVAILABLE" { |
56 | println!( | 56 | println!( |
57 | "\t └No new version found for the specified minecraft version" | 57 | " └No new version found for the specified minecraft version" |
58 | ); | 58 | ); |
59 | } else { | 59 | } else { |
60 | return Err(e); | 60 | return Err(e); |
@@ -76,10 +76,10 @@ pub async fn update( | |||
76 | if !clean { | 76 | if !clean { |
77 | for ver in current_versions { | 77 | for ver in current_versions { |
78 | if delete_old { | 78 | if delete_old { |
79 | println!("\t └Delete version {}", ver.0); | 79 | println!(" └Delete version {}", ver.0); |
80 | delete_version(current_list.clone(), ver.0)?; | 80 | delete_version(current_list.clone(), ver.0)?; |
81 | } else if ver.0 != "NONE" { | 81 | } else if ver.0 != "NONE" { |
82 | println!("\t └Disable version {}", ver.0); | 82 | println!(" └Disable version {}", ver.0); |
83 | disable_version(config.clone(), current_list.clone(), ver.0, ver.1)?; | 83 | disable_version(config.clone(), current_list.clone(), ver.0, ver.1)?; |
84 | }; | 84 | }; |
85 | } | 85 | } |