File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -51,11 +51,23 @@ const run = (ctx: any, name: string) => {
51
51
52
52
module . exports = ( ctx : any ) => {
53
53
ctx . commander . register ( 'init' , 'Create a new project' , ( ) => {
54
- const { root, rootPkg } = ctx ;
54
+ const { root, rootPkg, args } = ctx ;
55
+ const { g, generator } = args ;
56
+ const chooseGenerator = g || generator ;
57
+ let chooseGeneratorIsValid = false ;
58
+
55
59
loadGenerator ( root , rootPkg ) . then ( ( generators : any ) => {
56
60
const options = generators . map ( ( item : any ) => {
61
+ if ( item . name === chooseGenerator ) {
62
+ chooseGeneratorIsValid = true
63
+ }
57
64
return item . desc
58
65
} ) ;
66
+
67
+ if ( chooseGeneratorIsValid ) {
68
+ return run ( ctx , chooseGenerator ) ;
69
+ }
70
+
59
71
if ( generators . length ) {
60
72
inquirer . prompt ( [ {
61
73
type : 'list' ,
Original file line number Diff line number Diff line change 1
- declare module '@feflow/report' ;
1
+ declare module '@feflow/report' ;
2
+ declare module "request-promise"
You can’t perform that action at this time.
0 commit comments