run method

  1. @override
Future<int> run([
  1. List<String>? args
])
override

Runs this command.

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

Implementation

@override
Future<int> run([List<String>? args]) async {
  final argResults = args != null ? argParser.parse(args) : this.argResults;
  final providedConfigPath = argResults?['config'] as String?;

  final exitOnChange = argResults?['set-exit-if-changed'] as bool;

  final handler = BuildHandler(
    logger: logger,
    fs: fs,
    settings: settings,
    providedConfigPath: providedConfigPath,
    exitOnChange: exitOnChange,
    keyPressListener: null,
  );

  final result = await handler.run();

  return result;
}