File tree 1 file changed +18
-0
lines changed
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 1
1
/* eslint-disable no-console, import/no-cycle */
2
2
import prompts from 'prompts' ;
3
3
import path from 'path' ;
4
+ import { spawn } from 'child_process' ;
4
5
5
6
import {
6
7
copyTemplates ,
@@ -107,6 +108,23 @@ class Generator {
107
108
const { installDependencies } = this . options ;
108
109
if ( installDependencies === 'yarn' || installDependencies === 'npm' ) {
109
110
await installNpm ( this . options . destinationPath , installDependencies ) ;
111
+ await new Promise ( resolve => {
112
+ const install = spawn ( installDependencies , [ 'run' , 'analyze' ] , {
113
+ cwd : this . options . destinationPath ,
114
+ shell : true ,
115
+ } ) ;
116
+ install . stdout . on ( 'data' , data => {
117
+ console . log ( `${ data } ` . trim ( ) ) ;
118
+ } ) ;
119
+
120
+ install . stderr . on ( 'data' , data => {
121
+ console . log ( `analyze: ${ data } ` ) ;
122
+ } ) ;
123
+
124
+ install . on ( 'close' , ( ) => {
125
+ resolve ( ) ;
126
+ } ) ;
127
+ } ) ;
110
128
}
111
129
}
112
130
You can’t perform that action at this time.
0 commit comments