Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add hidden overwrite flag to the openapi upload cmd #1168

Open
wants to merge 1 commit into
base: next
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/commands/openapi/upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ export default class OpenAPIUploadCommand extends BaseCommand<typeof OpenAPIUplo

static flags = {
key: keyFlag,
overwrite: Flags.boolean({
description:
'If set, the overwrite prompt will be skipped. This flag can be a useful in automated environments where prompts cannot be responded to.',
hidden: true,
}),
slug: Flags.string({
summary: 'Override the slug (i.e., the unique identifier) for your API definition.',
description: [
Expand Down Expand Up @@ -137,7 +142,7 @@ export default class OpenAPIUploadCommand extends BaseCommand<typeof OpenAPIUplo
if (method === 'PUT') {
// bypass the prompt if we're in a CI environment
prompts.override({
confirm: isCI() ? true : undefined,
confirm: isCI() ? true : this.flags.overwrite,
});

const { confirm } = await promptTerminal({
Expand Down