checkFileExists method

void checkFileExists(
  1. String path,
  2. String entityName, {
  3. bool force = false,
})

Implementation

void checkFileExists(String path, String entityName, {bool force = false}) {
  if (File(path).existsSync() && !force) {
    throw Exception(
      '$entityName already exists at $path. Use --force to overwrite.',
    );
  }
}