update moves old mod to mods_old/

This commit is contained in:
iou1name 2019-06-05 11:14:55 -04:00
parent e0afebc5e6
commit 552e16e9cf

View File

@ -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))