existingSourceDirs top-level property

Set<Directory> existingSourceDirs

The subset of directories in sourceDirs which actually exist in the current working directory.

Implementation

Set<Directory> get existingSourceDirs => Directory.current
    .listSync()
    .where((f) => f is Directory)
    .map((d) => new Directory(path.relative(d.path)))
    .where((d) => sourceDirs.any((sd) => sd.path == d.path))
    .toSet();