From a0b6665ab05391282e477508c98180599e907079 Mon Sep 17 00:00:00 2001 From: baalajimaestro Date: Sun, 25 Sep 2022 16:54:48 +0530 Subject: [PATCH] Automatically ignore the cwd Signed-off-by: baalajimaestro --- encrypt.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/encrypt.py b/encrypt.py index b2317c7..d10ec69 100644 --- a/encrypt.py +++ b/encrypt.py @@ -13,14 +13,17 @@ from glob import glob import subprocess from time import time +cwd = os.getcwd() +path = Path(cwd) +base_dir = str(path.parent.absolute()) + # Blacklist, prevents handling these files altogether BLACKLIST = [ ".git", ".obsidian", ".idea", ".gitlab-ci.yml", - ".encrypt.py", - ".trigger.py", + cwd.split(base_dir + "/")[1] ] # Env vars to handle creds @@ -31,9 +34,6 @@ enc_repo_pass = os.environ.get("ENCRYPTED_REPO_PASSWORD") enc_key = os.environ.get("ENCRYPTION_KEY") # Create our encrypted directory base -cwd = os.getcwd() -path = Path(cwd) -base_dir = str(path.parent.absolute()) current_time = str(int(time())) os.mkdir(enc_path) os.chdir(enc_path)