Skip to content
Merged
Show file tree
Hide file tree
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
12 changes: 12 additions & 0 deletions src/cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,18 @@ describe('IDE validation', () => {
})
})

describe('--create-only flag handling', () => {
it('should skip validation when --create-only flag is used', async () => {
commandName = 'start'
commandOpts = { createOnly: true }

await validateIdeForStartCommand(createMockCommand())

expect(mockExit).not.toHaveBeenCalled()
expect(mockIsIdeAvailable).not.toHaveBeenCalled()
})
})

describe('startIde setting handling', () => {
it('should skip validation when startIde is false in settings', async () => {
commandName = 'start'
Expand Down
10 changes: 5 additions & 5 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,10 +325,10 @@ export async function validateIdeForStartCommand(command: Command): Promise<void
return
}

// Check if --no-code flag was passed (Commander stores negated option as 'code' = false)
const codeOption = command.opts()['code']
if (codeOption === false) {
return // User explicitly disabled IDE launch
// Check if --no-code or --create-only flag was passed
const opts = command.opts()
if (opts['code'] === false || opts['createOnly'] === true) {
return // IDE launch will be skipped
}

// Load settings to check IDE configuration and startIde default
Expand All @@ -343,7 +343,7 @@ export async function validateIdeForStartCommand(command: Command): Promise<void

// If startIde is explicitly false in workflow config and --code flag wasn't used, skip validation
const workflowConfig = settings.workflows?.issue
if (workflowConfig?.startIde === false && codeOption !== true) {
if (workflowConfig?.startIde === false && opts['code'] !== true) {
return
}

Expand Down
Loading