listFilesByGlob function
Lists all File FileSystemEntity
s matching the provided globs.
The globs will be combined to Match one of several possibilities {...,...}
See https://pub.dev/packages/glob for more information about globs
workingDirectory
will be the root path for the glob pattern to be
evaluated in. Defaults to the current working directory provided by
path.context
since 0.0.1
Implementation
//TODO add ability to specify FileSystem
Stream<FileSystemEntity> listFilesByGlob(
Iterable<String> globs, {
String? workingDirectory,
}) {
var context = StringUtil.isNotBlank(workingDirectory)
? path.Context(current: workingDirectory)
: path.context;
return Glob(
globs.length == 1 ? globs.first : "{${globs.join(',')}}",
context: context,
).list(root: context.current);
}