runWithConfig method

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

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

Implementation

@override
Future<void> runWithConfig(
  final Configuration<PasswordUnsetCommandConfig> commandConfig,
) async {
  final projectId = commandConfig.value(PasswordUnsetCommandConfig.projectId);
  final name = commandConfig.value(PasswordUnsetCommandConfig.name);

  final shouldDelete = await logger.confirm(
    'Are you sure you want to unset the password "$name"?',
    defaultValue: false,
  );

  if (!shouldDelete) {
    throw UserAbortException();
  }

  await PasswordCommands.unsetPassword(
    runner.serviceProvider.cloudApiClient,
    logger: logger,
    projectId: projectId,
    name: name,
  );
}