|
@@ -1,13 +1,13 @@
|
|
|
import { Command } from '@oclif/core'
|
|
|
-import { TEMPLATES, TemplateNames } from "../../template";
|
|
|
+import { TEMPLATES, TemplateNames } from '../../template'
|
|
|
import * as inquirer from 'inquirer'
|
|
|
-import Init from "../init";
|
|
|
+import Init from '../init'
|
|
|
|
|
|
export default class Create extends Command {
|
|
|
static description = '创建项目-命令行交互式'
|
|
|
|
|
|
static examples = [
|
|
|
- `$ jianyu create`
|
|
|
+ '$ jianyu create',
|
|
|
]
|
|
|
|
|
|
async run(): Promise<void> {
|
|
@@ -18,7 +18,7 @@ export default class Create extends Command {
|
|
|
type: 'input',
|
|
|
name: 'name',
|
|
|
default: 'new-project',
|
|
|
- message: '输入项目名称(同时用于目录名)'
|
|
|
+ message: '输入项目名称(同时用于目录名)',
|
|
|
},
|
|
|
{
|
|
|
type: 'list',
|
|
@@ -26,10 +26,10 @@ export default class Create extends Command {
|
|
|
default: TemplateNames[0],
|
|
|
choices: TemplateNames.map(v => ({
|
|
|
name: `${v} ${TEMPLATES[v].title}`,
|
|
|
- value: v
|
|
|
+ value: v,
|
|
|
})),
|
|
|
- message: '选择项目模板'
|
|
|
- }
|
|
|
+ message: '选择项目模板',
|
|
|
+ },
|
|
|
])
|
|
|
|
|
|
await Init.run(['-f', config.template, config.name])
|