Skip to content

Commit

Permalink
feat: generate manifest after installing
Browse files Browse the repository at this point in the history
  • Loading branch information
bennypowers committed Aug 18, 2021
1 parent 56fb92c commit 1c82db3
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/Generator.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint-disable no-console, import/no-cycle */
import prompts from 'prompts';
import path from 'path';
import { spawn } from 'child_process';

import {
copyTemplates,
Expand Down Expand Up @@ -107,6 +108,23 @@ class Generator {
const { installDependencies } = this.options;
if (installDependencies === 'yarn' || installDependencies === 'npm') {
await installNpm(this.options.destinationPath, installDependencies);
await new Promise(resolve => {
const install = spawn(installDependencies, ['run', 'analyze'], {
cwd: this.options.destinationPath,
shell: true,
});
install.stdout.on('data', data => {
console.log(`${data}`.trim());
});

install.stderr.on('data', data => {
console.log(`analyze: ${data}`);
});

install.on('close', () => {
resolve();
});
});
}
}

Expand Down

0 comments on commit 1c82db3

Please sign in to comment.