filePathsFromGlob function
Returns file paths matched by glob
and filtered to exclude any of the
following by default:
- Hidden files (filename starts with
.
) - Files in hidden directories (dirname starts with
.
)
If ignoreHiddenFiles
is false, these hidden files will be included.
Implementation
Iterable<String> filePathsFromGlob(Glob glob, {bool? ignoreHiddenFiles}) {
var files = glob.listSync().whereType<File>();
if (ignoreHiddenFiles ?? true) {
files = files.where(isNotHiddenFile);
}
return files.map((file) => file.path);
}