Remove enc_path if it exists

Signed-off-by: baalajimaestro <me@baalajimaestro.me>
This commit is contained in:
baalajimaestro 2023-06-11 21:31:13 +05:30
parent fb16a97bcf
commit 0391609c77
Signed by: baalajimaestro
GPG key ID: F93C394FE9BBAFD5

View file

@ -7,7 +7,7 @@
# Imports # Imports
from git import Repo from git import Repo
import os import os
from shutil import copytree from shutil import copytree, rmtree
from pathlib import Path from pathlib import Path
from glob import glob from glob import glob
import subprocess import subprocess
@ -36,6 +36,8 @@ enc_key = os.environ.get("ENCRYPTION_KEY")
# Create our encrypted directory base # Create our encrypted directory base
current_time = str(int(time())) current_time = str(int(time()))
if os.path.exists(enc_path):
rmtree(enc_path)
os.mkdir(enc_path) os.mkdir(enc_path)
os.chdir(enc_path) os.chdir(enc_path)