runWithOutput method
Future<void>
runWithOutput(
- Configuration<
UnsetVariableCommandConfig> commandConfig, - CommandOutput output
override
Runs this command with prepared configuration and output.
Subclasses should override this method.
Implementation
@override
Future<void> runWithOutput(
final Configuration<UnsetVariableCommandConfig> commandConfig,
final CommandOutput output,
) async {
final projectId = commandConfig.value(UnsetVariableCommandConfig.projectId);
final variableName = commandConfig.value(
UnsetVariableCommandConfig.variableName,
);
await VariableCommands.findVariable(
runner.serviceProvider.cloudApiClient,
baseCommand: baseCommand,
projectId: projectId,
name: variableName,
);
await confirmToContinue(
output,
message:
'Are you sure you want to remove the environment variable "$variableName"?',
defaultValue: false,
);
await renderCommand(
output,
operation: () => VariableCommands.unsetVariable(
runner.serviceProvider.cloudApiClient,
baseCommand: baseCommand,
projectId: projectId,
name: variableName,
),
textOutputUi: VariableUnsetTextUi(baseCommand: baseCommand),
);
}