fix: skip dir
This commit is contained in:
		
							parent
							
								
									07ff31a696
								
							
						
					
					
						commit
						9937bb8b1a
					
				|  | @ -54,18 +54,10 @@ func getForbiddens(root string, fileList []string, localList string) ([]string, | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		if info.IsDir() { | 		if info.IsDir() { | ||||||
| 			switch { | 			if info.Name() == ".git" || info.Name() == ".gitea" || info.Name() == "ci" || (localList != "" && inString(info.Name(), dirs)) { | ||||||
| 			case info.Name() == ".git" || info.Name() == ".gitea" || info.Name() == "ci": |  | ||||||
| 				return filepath.SkipDir |  | ||||||
| 			case localList != "": |  | ||||||
| 				if inString(info.Name(), dirs) { |  | ||||||
| 				return filepath.SkipDir | 				return filepath.SkipDir | ||||||
| 			} | 			} | ||||||
| 			default: | 		} else { | ||||||
| 				return nil |  | ||||||
| 			} |  | ||||||
| 		} |  | ||||||
| 
 |  | ||||||
| 			match := false | 			match := false | ||||||
| 			for _, regex := range regexList { | 			for _, regex := range regexList { | ||||||
| 				if regex.MatchString(info.Name()) { | 				if regex.MatchString(info.Name()) { | ||||||
|  | @ -77,6 +69,8 @@ func getForbiddens(root string, fileList []string, localList string) ([]string, | ||||||
| 			if !match { | 			if !match { | ||||||
| 				matches = append(matches, path) | 				matches = append(matches, path) | ||||||
| 			} | 			} | ||||||
|  | 		} | ||||||
|  | 
 | ||||||
| 		return nil | 		return nil | ||||||
| 	}) | 	}) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 zzjc1234
						zzjc1234