Skip to content

Commit

Permalink
feat: add prompt for init command
Browse files Browse the repository at this point in the history
  • Loading branch information
enxg committed Oct 9, 2021
1 parent 6204cea commit 67d5a10
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
63 changes: 63 additions & 0 deletions src/prompts/PromptInit.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import type { PromptObject } from 'prompts';

export const PromptInit = [
{
type: 'select',
name: 'configFormat',
message: 'What format do you want your config file to be in?',
choices: [
{ title: 'JSON', value: 'json' },
{ title: 'YAML', value: 'yml' }
]
},
{
type: 'select',
name: 'projectLanguage',
message: 'Choose the language used in your project',
choices: [
{ title: 'TypeScript', value: 'ts' },
{ title: 'JavaScript', value: 'js' }
]
},
{
type: 'text',
name: 'base',
message: 'Your base directory',
initial: 'src'
},
{
type: 'text',
name: 'commands',
message: 'Where do you store your commands? (do not include the base)',
initial: 'commands'
},
{
type: 'text',
name: 'listeners',
message: 'Where do you store your listeners? (do not include the base)',
initial: 'listeners'
},
{
type: 'text',
name: 'arguments',
message: 'Where do you store your arguments? (do not include the base)',
initial: 'arguments'
},
{
type: 'text',
name: 'preconditions',
message: 'Where do you store your preconditions? (do not include the base)',
initial: 'preconditions'
},
{
type: 'confirm',
name: 'cftEnabled',
message: 'Do you want to enable custom file templates?'
},
{
type: (prev) => (prev ? 'text' : null),
name: 'cftLocation',
message: 'Where do you store your custom file templates?',
initial: 'templates'
}
] as PromptObject<any>[];
1 change: 1 addition & 0 deletions src/prompts/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from '#prompts/PromptNew';
export * from '#prompts/PromptInit';

0 comments on commit 67d5a10

Please sign in to comment.