unsetBuildSecret static method
Future<void>
unsetBuildSecret(
- Client cloudApiClient, {
- required CommandLogger logger,
- required String projectId,
- required String name,
Implementation
static Future<void> unsetBuildSecret(
final Client cloudApiClient, {
required final CommandLogger logger,
required final String projectId,
required final String name,
}) async {
final shouldUnset = await logger.confirm(
'Are you sure you want to remove the build secret "$name"?',
defaultValue: false,
);
if (!shouldUnset) {
throw UserAbortException();
}
try {
await cloudApiClient.secrets.deleteBuild(
cloudCapsuleId: projectId,
key: name,
);
} on Exception catch (e, s) {
throw FailureException.nested(e, s, 'Failed to remove the build secret');
}
logger.success('Successfully removed build secret: $name.');
}