run method

  1. @override
Future<void> run()
override

Runs this command.

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

Implementation

@override
Future<void> run() async {
  config = ConfigService(projectDir);

  final reset = argResults!['reset'] as bool;
  final clientsOption = argResults!['clients'] as String?;
  final notifyOnly = argResults!['notify'] as bool;

  if (reset) {
    await _resetConfiguration();
    return;
  }

  if (clientsOption != null) {
    await _handleClientsSetup(clientsOption);
    return;
  }

  if (notifyOnly) {
    await _handleNotificationSetup();
    return;
  }

  // Default: Full project configuration setup
  await _handleProjectSetup();
}