X-Git-Url: https://git.armaanb.net/?p=lightcards.git;a=blobdiff_plain;f=lightcards%2Fprogress.py;h=b721a49148219c8bbeeee87f76086a6a90c14dc1;hp=f096da4bb3edd3e332fb0dd27652742bbf25ad02;hb=eec0373eb1745933e0ad618af7e79556427a4f6f;hpb=e99950c3023a64f68cdc968e2759f45653d6b9af diff --git a/lightcards/progress.py b/lightcards/progress.py index f096da4..b721a49 100644 --- a/lightcards/progress.py +++ b/lightcards/progress.py @@ -20,9 +20,8 @@ def name_gen(stra): def dump(obj, typer, stra): dired = f"{os.path.expanduser('~')}/.cache/lightcards/{name_gen(stra)}/" - if os.path.exists(dired): - shutil.rmtree(dired) - os.makedirs(dired) + if not os.path.exists(dired): + os.makedirs(dired) pickle.dump(obj, open(f"{dired}/{typer}.p", "wb"))