From 2ec20c50e7c02d82b248835988df040bd266b659 Mon Sep 17 00:00:00 2001
From: fxqnlr <felixquinn03@gmail.com>
Date: Sun, 4 Dec 2022 20:32:51 +0100
Subject: fully added mod remove; fixed update from NONE

---
 src/commands/update.rs | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

(limited to 'src/commands/update.rs')

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 @@
-use std::{io::{Error, ErrorKind}, fs::{rename, remove_file}};
+use std::{io::{Error, ErrorKind}, fs::rename};
 
 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};
 
@@ -70,14 +70,15 @@ pub async fn update(config: Cfg, input: Input) -> Result<(), Box<dyn std::error:
         }
         
         if input.direct_download { download_versions(current_list.clone(), updatestack).await?; };
-
+        
         //Disable old versions
         for ver in current_versions {
             if input.delete_old {
                 println!("Deleting version {} for mod {}", ver.0, ver.1);
                 delete_version(current_list.clone(), ver.0)?;
-            } else { 
-                disable_old(config.clone(), current_list.clone(), ver.0, ver.1)?
+            } else if ver.0 != "NONE" { 
+                println!("Disabling version {} for mod {}", ver.0, ver.1);
+                disable_old(config.clone(), current_list.clone(), ver.0, ver.1)?;
             };
         }
     }
-- 
cgit v1.2.3