executeCommands static method
Future<Map<ReleasePackerCommand, ReleasePackerCommandStatus> >
executeCommands(
- ReleasePacker releasePacker,
- List<
ReleasePackerCommand> ? commands, - Directory rootDirectory, {
- ReleaseBundle? releaseBundle,
- String? platform,
- String? context,
Executes commands that match platform.
Stops at the 1st command that fails and throws a ReleasePackerError, to avoid running the remaining commands over a broken build and generating an incomplete release bundle.
Implementation
static Future<Map<ReleasePackerCommand, ReleasePackerCommandStatus>>
executeCommands(
ReleasePacker releasePacker,
List<ReleasePackerCommand>? commands,
Directory rootDirectory, {
ReleaseBundle? releaseBundle,
String? platform,
String? context,
}) async {
var results = <ReleasePackerCommand, ReleasePackerCommandStatus>{};
if (commands == null || commands.isEmpty) return results;
for (var c in commands.where((e) => e.matchesPlatform(platform))) {
var status = await c.executeStatus(
releasePacker,
rootDirectory,
releaseBundle: releaseBundle,
);
results[c] = status;
if (status.isError) break;
}
print(' » Commands results:');
for (var e in results.entries) {
print(' - ${e.key} » ${e.value.name}');
}
print('');
checkCommandsResults(results, context: context);
return results;
}