run method

  1. @override
void run()
override

Runs this command.

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

Implementation

@override
void run() async {
  printMessage('\n${blue('Morpheme CLI Doctor')}');
  printMessage('${grey('Checking installed tools and dependencies...')}\n');

  int installedCount = 0;
  int requiredMissing = 0;

  for (final toolCheck in _toolChecks) {
    final isInstalled = await _checkTool(toolCheck);
    if (isInstalled) {
      installedCount++;
    } else if (toolCheck.isRequired) {
      requiredMissing++;
    }
  }

  _printSummary(installedCount, _toolChecks.length, requiredMissing);
}