]> git.armaanb.net Git - lightcards.git/commitdiff
Fix purge option
authorArmaan Bhojwani <me@armaanb.net>
Fri, 12 Feb 2021 18:56:16 +0000 (13:56 -0500)
committerArmaan Bhojwani <me@armaanb.net>
Fri, 12 Feb 2021 19:30:31 +0000 (14:30 -0500)
Both the runner.py execution and the progress.py implementation were
wrong

lightcards/progress.py
lightcards/runner.py

index 3be0247e42170c3243cf03814dc09b51b0ab38bc..8956b63ab7043063850bb29adf837eb8f4fb2eb0 100644 (file)
@@ -4,7 +4,6 @@
 import hashlib
 import os
 import pickle
-import shutil
 
 dired = f"{os.path.expanduser('~')}/.cache/lightcards/"
 
@@ -39,6 +38,6 @@ def dive(stra):
 
 def purge(stra):
     """Delete pickle file"""
-    file = f"{dired}/{name_gen(stra)}/"
+    file = f"{dired}/{name_gen(stra)}.p"
     if os.path.exists(file):
-        shutil.rmtree(file)
+        os.remove(file)
index e0af7d9e24e00746ca683e49e0537aac67e98f57..7c730776bb3a436ea4084a8e8413acf863e40bdf 100644 (file)
@@ -62,7 +62,7 @@ def show(args, stack, headers):
     """
     # Purge caches if asked
     if args.purge:
-        progress.purge(stack)
+        progress.purge(get_orig()[1])
 
     # Check for caches
     idx = Status()