From 0391609c77f4f03df31869f06e845bcffc92e761 Mon Sep 17 00:00:00 2001 From: baalajimaestro Date: Sun, 11 Jun 2023 21:31:13 +0530 Subject: [PATCH] Remove enc_path if it exists Signed-off-by: baalajimaestro --- encrypt.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/encrypt.py b/encrypt.py index 3fc70d6..b593b7b 100644 --- a/encrypt.py +++ b/encrypt.py @@ -7,7 +7,7 @@ # Imports from git import Repo import os -from shutil import copytree +from shutil import copytree, rmtree from pathlib import Path from glob import glob import subprocess @@ -36,6 +36,8 @@ enc_key = os.environ.get("ENCRYPTION_KEY") # Create our encrypted directory base current_time = str(int(time())) +if os.path.exists(enc_path): + rmtree(enc_path) os.mkdir(enc_path) os.chdir(enc_path)