From 5d1c23d533eac0bb3140f67d15d4952dcf2d3119 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Doma=C5=84ski?= Date: Tue, 26 Mar 2024 12:03:30 +0100 Subject: [PATCH] [gen_aliases] go deeper :) --- .config/scriptrc/gen_aliases.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/.config/scriptrc/gen_aliases.py b/.config/scriptrc/gen_aliases.py index af8d8a1..f825e5a 100644 --- a/.config/scriptrc/gen_aliases.py +++ b/.config/scriptrc/gen_aliases.py @@ -5,6 +5,7 @@ from shutil import which IGNORE = ["go", "parallels", "tmp", "library"] MAX_DEPTH = 5 +ENDING_DIRS = [".git", ".svn", ".hg", ".venv"] def subdirs(path): @@ -40,18 +41,9 @@ def process_dir(path, prefix="", depth=0): if depth >= MAX_DEPTH: return {} - if os.path.exists(os.path.join(path, ".git")): - # dont wanna go deepper into repo - 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 {} + for subdir in ENDING_DIRS: + if os.path.exists(os.path.abspath(os.path.join(path, "..", subdir))): + return {} dirs = subdirs(path) if depth == 0: