executeCommands static method

Future<Map<ReleasePackerCommand, bool>> executeCommands(
  1. ReleasePacker releasePacker,
  2. List<ReleasePackerCommand>? commands,
  3. Directory rootDirectory, {
  4. ReleaseBundle? releaseBundle,
  5. String? platform,
})

Implementation

static Future<Map<ReleasePackerCommand, bool>> executeCommands(
    ReleasePacker releasePacker,
    List<ReleasePackerCommand>? commands,
    Directory rootDirectory,
    {ReleaseBundle? releaseBundle,
    String? platform}) async {
  var results = <ReleasePackerCommand, bool>{};
  if (commands == null || commands.isEmpty) return results;

  for (var c in commands.where((e) => e.matchesPlatform(platform))) {
    var ok = await c.execute(releasePacker, rootDirectory,
        releaseBundle: releaseBundle);
    results[c] = ok;
  }

  print('   »  Commands results:');
  for (var e in results.entries) {
    print('     -  ${e.key} »  ${e.value}');
  }
  print('');

  return results;
}