From: Armaan Bhojwani Date: Fri, 12 Feb 2021 18:56:16 +0000 (-0500) Subject: Fix purge option X-Git-Tag: v0.6.0~1 X-Git-Url: https://git.armaanb.net/?p=lightcards.git;a=commitdiff_plain;h=85327074f6aaa4e46ec36cec6fd6f07317e96ea6 Fix purge option Both the runner.py execution and the progress.py implementation were wrong --- diff --git a/lightcards/progress.py b/lightcards/progress.py index 3be0247..8956b63 100644 --- a/lightcards/progress.py +++ b/lightcards/progress.py @@ -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) diff --git a/lightcards/runner.py b/lightcards/runner.py index e0af7d9..7c73077 100644 --- a/lightcards/runner.py +++ b/lightcards/runner.py @@ -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()