]> apps.delaporte.us Git - dotfiles.git/commitdiff
Fixup rmod
authorEdward Delaporte <edward@delaporte.us>
Wed, 23 Oct 2024 22:45:42 +0000 (17:45 -0500)
committerEdward Delaporte <edward@delaporte.us>
Wed, 23 Oct 2024 22:45:42 +0000 (17:45 -0500)
invoke/minetest/tasks.py

index 169e118f9a5d7d04483af02db6b2d8ef80cd65b8..3c39102c6a6dbddc513d08ecc72f447373f92aef 100644 (file)
@@ -114,14 +114,19 @@ def rmod(c, name):
         c.run(f"mv {mod_dir} {root}/mods_{bk}")
     else:
         print("Removing empty mod dir.")
         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"mkdir -p {mod_dir}")
+    c.run(f"mv {root}/mods_{name}/* {mod_dir}/")
     print(f"mods_{name} restored to mods")
     print("ls of root")
     c.run(f"ls {root}")
     print("ls of mods")
     c.run(f"ls {root}/mods")
 
     print(f"mods_{name} restored to mods")
     print("ls of root")
     c.run(f"ls {root}")
     print("ls of mods")
     c.run(f"ls {root}/mods")
 
+@task
+def listmods(c):
+    print("ls of mods")
+    c.run(f"ls {root}/mods/")
+
 @task
 def logs(c, lines=20):
     '''Output some logs'''
 @task
 def logs(c, lines=20):
     '''Output some logs'''