Skip to content

Commit 1c82db3

Browse files
committed
feat: generate manifest after installing
1 parent 56fb92c commit 1c82db3

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/Generator.js

+18
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* eslint-disable no-console, import/no-cycle */
22
import prompts from 'prompts';
33
import path from 'path';
4+
import { spawn } from 'child_process';
45

56
import {
67
copyTemplates,
@@ -107,6 +108,23 @@ class Generator {
107108
const { installDependencies } = this.options;
108109
if (installDependencies === 'yarn' || installDependencies === 'npm') {
109110
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+
});
110128
}
111129
}
112130

0 commit comments

Comments
 (0)