File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,16 +24,20 @@ yargs
2424 . command ( {
2525 command : '*' ,
2626 handler : ( args : IArgs ) => {
27- const { directory } = args ;
27+ const { directory, wrap } = args ;
2828
29- runGenerator ( { directory } )
29+ runGenerator ( { directory, wrap } )
3030 . then ( ( ) => process . exit ( 0 ) )
3131 . catch ( err => {
3232 Logger . error ( err ) ;
3333 process . exit ( 1 ) ;
3434 } ) ;
3535 } ,
3636 } )
37+ . option ( 'wrap' , {
38+ type : 'boolean' ,
39+ description : 'Wrap generated files in folder' ,
40+ } )
3741 . option ( 'directory' , {
3842 alias : 'd' ,
3943 type : 'string' ,
Original file line number Diff line number Diff line change @@ -8,11 +8,12 @@ import { FileGenerateManager } from './core/FileGenerateManager';
88import { CONFIG } from './constants' ;
99
1010export interface IArgs {
11+ wrap ?: boolean ;
1112 directory ?: string ;
1213}
1314
1415export async function runGenerator ( args : IArgs ) {
15- const { directory } = args ;
16+ const { directory, wrap } = args ;
1617 const { type } = await inquirer . prompt ( typeQuestion as any ) ;
1718
1819 process . stdout . write ( '\n' ) ;
@@ -21,6 +22,10 @@ export async function runGenerator(args: IArgs) {
2122 CONFIG . path = path . resolve ( process . cwd ( ) , directory ) ;
2223 }
2324
25+ if ( wrap != null ) {
26+ CONFIG . wrapFolder = wrap ;
27+ }
28+
2429 switch ( type ) {
2530 case 'component' : {
2631 const answers = await inquirer . prompt ( questionTypes . getComponentQuestions ( ) ) ;
You can’t perform that action at this time.
0 commit comments