From 85327074f6aaa4e46ec36cec6fd6f07317e96ea6 Mon Sep 17 00:00:00 2001 From: Armaan Bhojwani Date: Fri, 12 Feb 2021 13:56:16 -0500 Subject: [PATCH] Fix purge option Both the runner.py execution and the progress.py implementation were wrong --- lightcards/progress.py | 5 ++--- lightcards/runner.py | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) 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() -- 2.39.2