checkTargetFilesExistance method

Future<void> checkTargetFilesExistance(
  1. Iterable<File> files
)

Checks that all target files does not exist

throws GeneratorTargetFileExistsException otherwise

Implementation

Future<void> checkTargetFilesExistance(Iterable<File> files) async {
  await Future.wait(
    files.map(
      (file) async {
        if (file.existsSync()) {
          throw GeneratorTargetFileExistsException(file.path);
        }
      },
    ),
  );
}