[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"]
 | 
			
		||||
MAX_DEPTH = 5
 | 
			
		||||
ENDING_DIRS = [".git", ".svn", ".hg", ".venv"]
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def subdirs(path):
 | 
			
		||||
| 
						 | 
				
			
			@ -40,17 +41,8 @@ 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")):
 | 
			
		||||
    for subdir in ENDING_DIRS:
 | 
			
		||||
        if os.path.exists(os.path.abspath(os.path.join(path, "..", subdir))):
 | 
			
		||||
            return {}
 | 
			
		||||
 | 
			
		||||
    dirs = subdirs(path)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue