run method

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

Runs this command.

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

Implementation

@override
FutureOr<bool> run() async {
  var templatePath = argTemplate;

  if (templatePath == null) {
    showErrorOptionNotProvided('template');
  }

  if (hasError) {
    return false;
  }

  printToConsole(cliTitle);

  printToConsole('\nTEMPLATE:\n  $templatePath');

  var template = await loadTemplate(templatePath!);

  var entriesPaths = template.entriesPaths;

  printToConsole('\nENTRIES(${entriesPaths.length}):');

  for (var e in entriesPaths) {
    printToConsole('  > $e');
  }

  showTemplateInfos(template);

  return true;
}