Skip to content

Commit

Permalink
fix: make ai fields to be optional (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
recallwei committed Mar 30, 2024
1 parent b7ba5b4 commit 5c007ce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/cz-git/src/generator/questionAI.ts
Expand Up @@ -16,7 +16,7 @@ import { generateAISubjects } from './message'

export async function generateAIPrompt(options: CommitizenGitOptions, cz: CommitizenType) {
const answers = await cz.prompt(generateAITypesQuestions(options))
console.log(style.green('ℹ'), style.bold(options.messages!.generatingByAI))
console.log(style.green('ℹ'), style.bold(options.messages!.generatingByAI!))
const subjects = await generateAISubjects(answers, options)
if (!Array.isArray(subjects))
throw new Error('subjects fetch value failed')
Expand Down
4 changes: 2 additions & 2 deletions packages/cz-git/src/shared/types/options.ts
Expand Up @@ -82,11 +82,11 @@ export interface Answers {
/**
* @default 'Generating your AI commit subject...'
*/
generatingByAI: string
generatingByAI?: string
/**
* @default 'Select suitable subject by AI generated:'
*/
generatedSelectByAI: string
generatedSelectByAI?: string
footerPrefix?: string
}

Expand Down

0 comments on commit 5c007ce

Please sign in to comment.