[gen_aliases] go deeper :)

This commit is contained in:
Piotr Domański 2024-03-26 12:03:30 +01:00
parent 26f8f81870
commit 5d1c23d533

View file

@ -5,6 +5,7 @@ from shutil import which
IGNORE = ["go", "parallels", "tmp", "library"] IGNORE = ["go", "parallels", "tmp", "library"]
MAX_DEPTH = 5 MAX_DEPTH = 5
ENDING_DIRS = [".git", ".svn", ".hg", ".venv"]
def subdirs(path): def subdirs(path):
@ -40,18 +41,9 @@ def process_dir(path, prefix="", depth=0):
if depth >= MAX_DEPTH: if depth >= MAX_DEPTH:
return {} return {}
if os.path.exists(os.path.join(path, ".git")): for subdir in ENDING_DIRS:
# dont wanna go deepper into repo if os.path.exists(os.path.abspath(os.path.join(path, "..", subdir))):
return {} return {}
if os.path.exists(os.path.join(path, ".hg")):
return {}
if os.path.exists(os.path.join(path, ".svn")):
return {}
if os.path.exists(os.path.join(path, ".venv")):
return {}
dirs = subdirs(path) dirs = subdirs(path)
if depth == 0: if depth == 0: