run method

  1. @override
Future<void> run()
override

Runs this command.

The return value is wrapped in a Future if necessary and returned by CommandRunner.runCommand.

Implementation

@override
Future<void> run() async {
  final exitCodes = <int>[];
  for (final target in targets) {
    if (!await target.hasChangedSince(since)) continue;

    exitCodes.add(await runOnPackage(target));
  }

  final hasFailed = exitCodes.any((code) => code != 0);

  if (hasFailed) {
    exit(1);
  }
}