run method

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

Runs this command.

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

Implementation

@override
Future<bool> run() async {
  final blockLogger = logger.headerBlock('Checks');
  useSequence([
    CheckToolsTask(this, blockLogger),
    CheckFSTask(this, blockLogger),
  ]);

  bool result = await runSequence({
    CheckToolsTask.taskName: {'fix': useFix},
    CheckFSTask.taskName: {'fix': useFix}
  });

  if (!result) {
    logger.printWarn(
        'Some errors can be fixed automatically using the '
        '${'endaft check --fix'}.',
        inBl);
  }

  return blockLogger.close(result);
}