renameResult method
Renames this stack and returns a typed operation result.
Implementation
Future<AutomationRenameResult> renameResult(
String stackName, {
bool check = true,
bool includeSummary = true,
bool showSummarySecrets = false,
bool captureEvents = false,
AutomationEngineEventHandler? onEvent,
List<String> extraArgs = const <String>[],
}) async {
if (workspace.remote && showSummarySecrets) {
throw ArgumentError(
"can't enable `showSummarySecrets` for remote workspaces",
);
}
final args = <String>['stack', 'rename', stackName];
args.addAll(extraArgs);
final (result, events) = await _runStackCommand(
args,
check: check,
captureEvents: captureEvents,
onEvent: onEvent,
);
AutomationUpdateSummary? summary;
if (result.succeeded) {
name = stackName;
if (includeSummary) {
final effectiveShowSummarySecrets = workspace.remote
? false
: showSummarySecrets;
summary = workspace.remote
? await _awaitTerminalRemoteSummary(
showSecrets: effectiveShowSummarySecrets,
)
: await infoSummary(showSecrets: effectiveShowSummarySecrets);
}
}
return AutomationRenameResult(
commandResult: result,
events: events,
summary: summary,
);
}