run method

Future<void> run({
  1. required BuildSettings settings,
  2. StepListener? listener,
})

Implementation

Future<void> run({
  required BuildSettings settings,
  StepListener? listener,
}) async {
  var transaction = BuildTransaction(
    settings: settings,
    env: {},
  );

  for (final step in steps) {
    listener?.onStepChanged(step, StepStatus.inProgress);

    try {
      final updatedTransaction = await step.handle(transaction);
      listener?.onStepChanged(step, StepStatus.completed);
      transaction = updatedTransaction;
    } on Exception catch (error) {
      listener?.onStepChanged(step, StepStatus.error, error);
      rethrow;
    }
  }
}