runWithOutput method

  1. @override
Future<void> runWithOutput(
  1. Configuration<BuildLogOption> commandConfig,
  2. CommandOutput output
)
override

Runs this command with prepared configuration and output.

Subclasses should override this method.

Implementation

@override
Future<void> runWithOutput(
  final Configuration<BuildLogOption> commandConfig,
  final CommandOutput output,
) async {
  final projectId = commandConfig.value(BuildLogOption.projectId);
  final inUtc = commandConfig.value(BuildLogOption.utc);
  final deploymentArg = commandConfig.optionalValue(BuildLogOption.deploy);

  final client = runner.serviceProvider.cloudApiClient;
  final attemptId = await DeploymentCommands.getDeployAttemptId(
    client,
    baseCommand: baseCommand,
    commandNames: _commandNames,
    projectId: projectId,
    deploymentArg: deploymentArg,
  );

  await renderCommand(
    output,
    operation: () => LogsOperations.fetchBuildLog(
      client,
      projectId: projectId,
      attemptId: attemptId,
    ),
    textOutputUi: BuildLogListTextUi(utc: inUtc, attemptId: attemptId),
  );
}