chore: search by type with empty file name (#1228)
This commit is contained in:
		
							parent
							
								
									c8257e848e
								
							
						
					
					
						commit
						b6263eb607
					
				| 
						 | 
				
			
			@ -75,7 +75,7 @@ func parseSearch(value string) *searchOptions {
 | 
			
		|||
		value = typeRegexp.ReplaceAllString(value, "")
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// If it's canse insensitive, put everything in lowercase.
 | 
			
		||||
	// If it's case insensitive, put everything in lowercase.
 | 
			
		||||
	if !opts.CaseSensitive {
 | 
			
		||||
		value = strings.ToLower(value)
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -65,6 +65,10 @@ func Search(fs afero.Fs, scope, query string, checker rules.Checker, found func(
 | 
			
		|||
					return found(originalPath, f)
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		} else {
 | 
			
		||||
			originalPath = strings.TrimPrefix(originalPath, scope)
 | 
			
		||||
			originalPath = strings.TrimPrefix(originalPath, "/")
 | 
			
		||||
			return found(originalPath, f)
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		return nil
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue