Skip to content
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
20 changes: 19 additions & 1 deletion src/commands/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ export default class Create extends Command {
author: flags.string({char: 'a', description: 'Author\'s name'}),
homepage: flags.string({char: 'H', description: 'Author\'s or app\'s home page'}),
support: flags.string({char: 's', description: 'URL or email address to get support for the app'}),
type: flags.string({char: 't', description: 'App type (chatbot/integration)'}),
category: flags.string({char: 'c', description: 'App category (chatbot/integration/other)'}),
};

public async run() {
Expand All @@ -43,7 +45,23 @@ export default class Create extends Command {
this.log('We need some information first:');
this.log('');

const { flags } = this.parse(Create);
const appType = await cli.prompt(
chalk.bold(' App Type (chatbot/integration)'),
{ default: 'chatbot' }
).then((input: string) => input.toLowerCase());

this.log(`Selected App Type: ${chalk.green(appType)}`);
this.log('');

const appCategory = flags.category ? flags.category.toLowerCase() : await cli.prompt(
chalk.bold(' App Category (chatbot/integration/other)'),
{ default: 'other' }
).then((input: string) => input.toLowerCase());

this.log(`Selected Category: ${chalk.green(appCategory)}`);
this.log('');

this.log(chalk.gray('(Use lowercase letters, numbers, and hyphens only, e.g., my-app)'));
info.name = flags.name ? flags.name : await cli.prompt(chalk.bold(' App Name'));
info.nameSlug = VariousUtils.slugify(info.name);
info.classFile = `${ pascalCase(info.name) }App.ts`;
Expand Down