runWithContext method

Future<void> runWithContext(
  1. Command command,
  2. CommandContext context
)

Runs a Command with the given CommandContext.

Implementation

Future<void> runWithContext(Command command, CommandContext context) async {
  try {
    await command.run(context);
  } on CommandError catch (error) {
    newline();
    final message =
        'Error: ${error.message}'.consoleText(style: ConsoleStyle.error);
    report(message);
  }
}