run method

  1. @override
FutureOr? run()
override

Runs this command.

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

Implementation

@override
FutureOr? run() async {
  final results = argResults;
  if (results == null) throw ArgumentError('No arguments provided');
  final flutterBuild = FlutterBuild(
    appName: results[argAppName] as String,
    appVersion: results[argAppVersion] as String?,
    buildNumber: int.tryParse(results[argBuildNumber] ?? ''),
    buildVersion: results[argBuildVersion] as String?,
    buildArgs: results[argBuildArg] as List<String>,
    releaseFolder: results[argReleaseFolder] as String?,
  );
  final platformBuild = getPlatformBuild(results, flutterBuild);
  stdout.writeln(await platformBuild.build());
}