exec method

  1. @override
Future<void> exec(
  1. ExecContext context
)
override

Run command.

The contents of katana.yaml and the arguments of the command are passed to context.

コマンドを実行します。

contextkatana.yamlの内容やコマンドの引数が渡されます。

Implementation

@override
Future<void> exec(ExecContext context) async {
  final p12RegExp = RegExp(r".p12$");
  final pemRegExp = RegExp(r".pem$");
  final p12 = await find(Directory("ios"), p12RegExp);
  final pem = await find(Directory("ios"), pemRegExp);
  if (p12 != null) {
    await p12.delete();
  }
  if (pem != null) {
    await pem.delete();
  }
  final enabled =
      _actions.where((element) => element.checkEnabled(context)).toList();
  for (final action in enabled) {
    // ignore: avoid_print
    print(
      """


###############################################################################

${action.description}

###############################################################################

""",
    );
    await action.exec(context);
  }
}