runWithConfig method

  1. @override
Future<void> runWithConfig(
  1. Configuration<DeploymentsBuildLogOption> commandConfig
)
override

Runs this command with prepared configuration (options). Subclasses should override this method.

Implementation

@override
Future<void> runWithConfig(
    final Configuration<DeploymentsBuildLogOption> commandConfig) async {
  final projectId = commandConfig.value(DeploymentsBuildLogOption.projectId);
  final inUtc = commandConfig.value(DeploymentsBuildLogOption.utc);
  final deploymentArg =
      commandConfig.optionalValue(DeploymentsBuildLogOption.deploy);

  try {
    final attemptId = await _getDeployAttemptId(
      runner.serviceProvider.cloudApiClient,
      projectId,
      deploymentArg,
    );

    await LogsFeature.fetchBuildLog(
      runner.serviceProvider.cloudApiClient,
      writeln: logger.line,
      projectId: projectId,
      attemptId: attemptId,
      inUtc: inUtc,
    );
  } on Exception catch (e, s) {
    throw FailureException.nested(e, s, 'Failed to get build log');
  }
}