runWithConfig method
Runs this command with prepared configuration (options). Subclasses should override this method.
Implementation
@override
Future<void> runWithConfig(
final Configuration<DbResetPasswordOption> commandConfig,
) async {
final projectId = commandConfig.value(DbResetPasswordOption.projectId);
final username = commandConfig.value(DbResetPasswordOption.username);
final apiCloudClient = runner.serviceProvider.cloudApiClient;
try {
final password = await apiCloudClient.database.resetDatabasePassword(
cloudCapsuleId: projectId,
username: username,
);
logger.success(
'''
DB password is reset. The new password is only shown this once:
$password''',
);
} on Exception catch (e, stackTrace) {
throw FailureException.nested(e, stackTrace, 'Failed to reset password');
}
}