[gen_aliases] go deeper :)
This commit is contained in:
parent
26f8f81870
commit
5d1c23d533
1 changed files with 4 additions and 12 deletions
|
@ -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,17 +41,8 @@ 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 {}
|
|
||||||
|
|
||||||
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 {}
|
return {}
|
||||||
|
|
||||||
dirs = subdirs(path)
|
dirs = subdirs(path)
|
||||||
|
|
Loading…
Reference in a new issue