@@ -27,28 +27,19 @@ for (const constantKey of constantKeys) {
2727program . option ( '-p, --plugins [plugin...]' , 'specify an array of plugin file pathname' ) ;
2828
2929program . action ( async ( ...result ) => {
30- const props = result [ 0 ] || { } as DollieBaseAppConfig ;
31- const constants = Object . keys ( _ . omit ( props , [ 'plugins' ] ) ) . reduce ( ( result , currentKey ) => {
32- const currentSnakeKey = parseCamelToSnake ( currentKey ) ;
33- const currentValue = ( props [ 0 ] || { } ) [ currentKey ] ;
34- if ( currentSnakeKey && currentValue !== undefined ) {
35- const snakeKey = currentSnakeKey . toUpperCase ( ) as keyof ExportedConstants ;
36- if ( snakeKey === 'SCAFFOLD_TIMEOUT' ) {
37- result [ snakeKey ] = parseInt ( currentValue , 10 ) || 10000 ;
38- } else {
39- result [ snakeKey ] = currentValue ;
40- }
41- }
42- return result ;
43- } , { } ) as ExportedConstants ;
30+ const rawProps = ( result [ 0 ] || { } ) ;
31+ const props = _ . omit ( rawProps , [ 'plugins' ] ) as Partial < DollieBaseAppConfig > ;
32+ if ( props . scaffoldTimeout !== undefined ) {
33+ props . scaffoldTimeout = parseInt ( rawProps . scaffoldTimeout , 10 ) ;
34+ }
4435 try {
45- const pluginPaths = ( _ . isArray ( props . plugins ) ? props . plugins : [ ] ) as Array < string > ;
36+ const pluginPaths = ( _ . isArray ( rawProps . plugins ) ? rawProps . plugins : [ ] ) as Array < string > ;
4637 const plugins = pluginPaths . map ( ( pluginPath ) => ( {
4738 pathname : pluginPath ,
4839 executor : require ( path . resolve ( pluginPath ) ) ,
4940 } ) ) as Array < Plugin > ;
5041 await dollie . interactive ( {
51- constants ,
42+ ... props ,
5243 plugins,
5344 } ) ;
5445 } catch ( e ) {
0 commit comments