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
14 changes: 14 additions & 0 deletions src/commands/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ export default class Create extends Command {
this.log('We need some information first:');
this.log('');

const appType = await cli.prompt(
chalk.bold(' App Type (chatbot/integration)'),
{ default: 'chatbot' }
);

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

const { flags } = this.parse(Create);
info.name = flags.name ? flags.name : await cli.prompt(chalk.bold(' App Name'));
info.nameSlug = VariousUtils.slugify(info.name);
Expand All @@ -53,6 +61,12 @@ export default class Create extends Command {
info.author.homepage = flags.homepage ? flags.homepage : await cli.prompt(chalk.bold(' Author\'s Home Page'));
info.author.support = flags.support ? flags.support : await cli.prompt(chalk.bold(' Author\'s Support Page'));


if (!/^[a-z0-9-]+$/i.test(info.name)) {
this.error('App name must contain only letters, numbers, and hyphens (no spaces or special characters)');
return;
}

const folder = path.join(process.cwd(), info.nameSlug);

cli.action.start(`Creating a Rocket.Chat App in ${ chalk.green(folder) }`);
Expand Down