createHomeFeature method

Future<void> createHomeFeature(
  1. String projectDir
)

Implementation

Future<void> createHomeFeature(String projectDir) async {
  try {
    // Create a command runner specifically for the feature command
    final featureCommand = FeatureCommand();

    // Create a command runner
    final runner = CommandRunner('blocy', 'BLoC CLI')
      ..addCommand(featureCommand);

    // Run the feature command with home argument
    await runner.run(['feature', 'home', '--project-dir', projectDir]);
  } catch (e) {
    printWarning('Could not create home feature automatically: $e');
    printWarning('You can manually create it by running: blocy feature home');
  }
}