run method
Runs this command.
The return value is wrapped in a Future if necessary and returned by
CommandRunner.runCommand.
Implementation
@override
void run() async {
final argMorphemeYaml = argResults.getOptionMorphemeYaml();
final argFlavor = argResults.getOptionFlavor(defaultTo: '');
try {
// Execute the complete asset generation workflow
final result = await _orchestrator.execute(
morphemeYamlPath: argMorphemeYaml,
flavor: argFlavor.isNotEmpty ? argFlavor : null,
);
if (result.isSuccess) {
_reportSuccess(result);
} else {
_reportFailure(result);
}
} catch (e, stackTrace) {
StatusHelper.failed(
'Unexpected error during asset generation: $e',
suggestion:
'Check the error details and ensure all requirements are met',
examples: [
'morpheme generate assets --help',
'morpheme doctor',
],
);
print('Stack trace: $stackTrace');
}
}