follow static method
Future<void>
follow(
- Client cloudApiClient, {
- required CommandLogger logger,
- required String projectId,
- required List<
AppBuildRef> builds, - String? versionName,
- bool showLogs = false,
Shows a status line per build in builds of project projectId,
updated on every change until all builds have ended, and then their
result.
On an interactive terminal the lines are redrawn in place, with a
spinner on the active stages. With showLogs, the log of each build
step scrolls below the lines as the step ends. The log is cleared when
every build succeeds, and kept in full otherwise. Without an
interactive terminal, a line is printed each time it changes, and no
log is shown. A step log that cannot be fetched shows as error lines in
the log, and its cause is logged at debug level once the builds end.
Throws FailureException if a build does not succeed.
Implementation
static Future<void> follow(
Client cloudApiClient, {
required CommandLogger logger,
required String projectId,
required List<AppBuildRef> builds,
String? versionName,
bool showLogs = false,
}) async {
final detailStream = StreamGroup.merge([
for (final build in builds)
AppOperations.tailBuild(
cloudApiClient,
projectId: projectId,
buildId: build.buildId,
),
]);
final terminal = logger.inlineTerminal;
final details = terminal.hasTerminal
? await _renderProgress(
cloudApiClient,
detailStream,
logger: logger,
terminal: terminal,
projectId: projectId,
builds: builds,
showLogs: showLogs,
)
: await _printProgress(detailStream, logger: logger, builds: builds);
_report(
logger,
platforms: [for (final build in builds) build.platform],
details: details,
versionName: versionName,
);
}