cleanStaleFiles method

int cleanStaleFiles({
  1. bool dryRun = false,
})

Deletes stale *.g.dart files. Returns the number of files removed. When dryRun is true, only reports; does not delete.

Implementation

int cleanStaleFiles({bool dryRun = false}) {
  final stale = findStaleGeneratedFiles();
  for (final f in stale) {
    if (!dryRun) f.deleteSync();
  }
  return stale.length;
}