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 {
  try {
    final argFlavor = argResults.getOptionFlavor(defaultTo: Constants.dev);

    printMessage('🎨 Deploying launcher icons for flavor: $argFlavor');

    // Validate source directories exist before proceeding
    _validateSourceDirectories(argFlavor);

    // Deploy icons to both platforms
    _deployAndroidIcons(argFlavor);
    _deployIosIcons(argFlavor);

    printMessage('🎉 Successfully deployed launcher icons to all platforms');
    StatusHelper.success('ic-launcher deployment completed');
  } catch (e) {
    StatusHelper.failed('Failed to deploy launcher icons: $e');
  }
}