From 552e16e9cf6cbb038702e3b0603e4e4b1a2c6d27 Mon Sep 17 00:00:00 2001 From: iou1name Date: Wed, 5 Jun 2019 11:14:55 -0400 Subject: [PATCH] update moves old mod to mods_old/ --- overwrought_master.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/overwrought_master.py b/overwrought_master.py index 9ce2f6f..3add1c8 100755 --- a/overwrought_master.py +++ b/overwrought_master.py @@ -201,7 +201,12 @@ def update_mod(target, delete=False, phase=None): download_mod(mod_latest) mod_latest.save() log_change(f"Updated {mod_latest.title} to {mod_latest.filename}") - if delete: + if not delete: + os.makedirs("mods_old", exist_ok=True) + os.rename(os.path.join("mods", mod_current.filename), + os.path.join("mods_old", mod_current.filename) + ) + else: os.remove(os.path.join("mods", mod_current.filename))