+
+@task
+def bkmod(c, name=None):
+ '''Save the current set of mods and create an empty mod directory.'''
+ if not name:
+ name = datetime.datetime.now().strftime("%Y%h%d%H%M")
+ c.run(f"mv {mod_dir} {root}/mods_{name}")
+ c.run(f"mkdir -p {mod_dir}")
+ c.run(f"ls {root}")
+
+@task
+def rmod(c, name):
+ '''Restore a backed up set of mods.'''
+ if len(os.listdir(f"{mod_dir}")) != 0:
+ bk = datetime.datetime.now().strftime("%Y%h%d%H%M")
+ print(f"Backed up non-emtpy mod dir to mods_{bk}.")
+ c.run(f"mv {mod_dir} {root}/mods_{bk}")
+ else:
+ print("Removing empty mod dir.")
+ c.run(f"rmdir {mod_dir}")
+ c.run(f"mv {root}/mods_{name} {mod_dir}")
+ c.run(f"ls {root}")
+
+