shouldIncludeFile function
Check if a filename should be included based on include/exclude glob patterns.
Implementation
bool shouldIncludeFile(
String fileName, List<String> include, List<String> exclude) {
if (include.isNotEmpty) {
final matchesInclude =
include.any((pattern) => _globMatches(pattern, fileName));
if (!matchesInclude) return false;
}
if (exclude.isNotEmpty) {
final matchesExclude =
exclude.any((pattern) => _globMatches(pattern, fileName));
if (matchesExclude) return false;
}
return true;
}