printJob method

Future printJob()

Prints job configuration information to the console.

Displays the job type (Build/Publish) and all non-empty configuration values in a formatted, easy-to-read manner.

Implementation

Future printJob() async {
  final rawArguments = toJson();
  // Remove null, empty lists, and empty string values for cleaner output
  rawArguments.removeWhere(
    (key, value) =>
        value == null || ((value is List) && value.isEmpty) || value == "",
  );

  // Determine job type based on instance type
  String type = this is BuildArguments ? "Build" : "Publish";
  logger.logInfo("Running $type with configurations:");

  // Display each configuration key-value pair
  for (var value in rawArguments.keys) {
    logger.logInfo(" - $value: ${rawArguments[value]}");
  }
  logger.logEmpty();
}