UNPKG

@swell/cli

Version:

Swell's command line interface/utility

47 lines (46 loc) 1.4 kB
import { select } from '@inquirer/prompts'; import { Command } from '@oclif/core'; export default class Create extends Command { static description = 'Scaffold apps, models, functions, and notifications.'; static examples = ['<%= config.bin %> <%= command.id %>']; async run() { const createTarget = await select({ choices: [ { name: 'App', value: 'app', }, { name: 'Model', value: 'model', }, { name: 'Content', value: 'content', }, { name: 'Function', value: 'function', }, { name: 'Notification', value: 'notification', }, { name: 'Setting', value: 'setting', }, { name: 'Tests', value: 'tests', }, { name: 'Webhook', value: 'webhook', }, ], message: 'What do you want to create?', }); await this.config.runCommand(`create:${createTarget}`); } }