execute method
Executes the command using the parsed results.
Implementation
@override
Future<void> execute(
ArgResults results,
) async {
final config = await ConfigService.load();
final flavor = results.rest.isEmpty ? config.defaultFlavor : results.rest.first;
final platform = switch (results['platform'] as String) {
'android' => BuildPlatform.apk,
'ios' => BuildPlatform.ipa,
'web' => BuildPlatform.web,
_ => BuildPlatform.apk,
};
BuildMode mode = BuildMode.debug;
if (results['profile']) {
mode = BuildMode.profile;
}
if (results['release']) {
mode = BuildMode.release;
}
await BuildService().run(
platform: platform,
flavor: flavor,
mode: mode,
);
}