diff options
author | fxqnlr <[email protected]> | 2022-12-04 20:32:51 +0100 |
---|---|---|
committer | fxqnlr <[email protected]> | 2022-12-04 20:32:51 +0100 |
commit | 2ec20c50e7c02d82b248835988df040bd266b659 (patch) | |
tree | a8306a2c07438068dcd190762d3f77e68064b448 /src/commands/update.rs | |
parent | f3f746be6c1c19c93d440bbc210dec631e2b42bb (diff) | |
download | modlist-2ec20c50e7c02d82b248835988df040bd266b659.tar modlist-2ec20c50e7c02d82b248835988df040bd266b659.tar.gz modlist-2ec20c50e7c02d82b248835988df040bd266b659.zip |
fully added mod remove; fixed update from NONE
Diffstat (limited to 'src/commands/update.rs')
-rw-r--r-- | src/commands/update.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/commands/update.rs b/src/commands/update.rs index 482e588..bf13319 100644 --- a/src/commands/update.rs +++ b/src/commands/update.rs | |||
@@ -1,4 +1,4 @@ | |||
1 | use std::{io::{Error, ErrorKind}, fs::{rename, remove_file}}; | 1 | use std::{io::{Error, ErrorKind}, fs::rename}; |
2 | 2 | ||
3 | use crate::{config::Cfg, modrinth::{projects, Project, versions, extract_current_version, Version}, get_current_list, db::{userlist_get_all_ids, mods_get_versions, userlist_get_applicable_versions, userlist_change_versions, lists_get_all_ids, lists_get, userlist_get_current_version, userlist_add_disabled_versions, mods_change_versions}, List, input::Input, files::{get_file_path, delete_version}, download_versions}; | 3 | use crate::{config::Cfg, modrinth::{projects, Project, versions, extract_current_version, Version}, get_current_list, db::{userlist_get_all_ids, mods_get_versions, userlist_get_applicable_versions, userlist_change_versions, lists_get_all_ids, lists_get, userlist_get_current_version, userlist_add_disabled_versions, mods_change_versions}, List, input::Input, files::{get_file_path, delete_version}, download_versions}; |
4 | 4 | ||
@@ -70,14 +70,15 @@ pub async fn update(config: Cfg, input: Input) -> Result<(), Box<dyn std::error: | |||
70 | } | 70 | } |
71 | 71 | ||
72 | if input.direct_download { download_versions(current_list.clone(), updatestack).await?; }; | 72 | if input.direct_download { download_versions(current_list.clone(), updatestack).await?; }; |
73 | 73 | ||
74 | //Disable old versions | 74 | //Disable old versions |
75 | for ver in current_versions { | 75 | for ver in current_versions { |
76 | if input.delete_old { | 76 | if input.delete_old { |
77 | println!("Deleting version {} for mod {}", ver.0, ver.1); | 77 | println!("Deleting version {} for mod {}", ver.0, ver.1); |
78 | delete_version(current_list.clone(), ver.0)?; | 78 | delete_version(current_list.clone(), ver.0)?; |
79 | } else { | 79 | } else if ver.0 != "NONE" { |
80 | disable_old(config.clone(), current_list.clone(), ver.0, ver.1)? | 80 | println!("Disabling version {} for mod {}", ver.0, ver.1); |
81 | disable_old(config.clone(), current_list.clone(), ver.0, ver.1)?; | ||
81 | }; | 82 | }; |
82 | } | 83 | } |
83 | } | 84 | } |