Skip to content
Permalink
Browse files

chore(initializer): output logs of the install step on failure

  • Loading branch information
MarshallOfSound authored and malept committed Dec 11, 2016
1 parent f6f9664 commit 20c0b12a6588d75a15084e2ce007ebfed2c34472
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/util/install-dependencies.js
@@ -25,10 +25,15 @@ export default (dir, deps, areDev = false, exact = false) => {
d('executing', JSON.stringify(cmd), 'in:', dir);
const child = yarnOrNPMSpawn(cmd, {
cwd: dir,
stdio: config.get('verbose') ? 'inherit' : 'ignore',
stdio: config.get('verbose') ? 'inherit' : 'pipe',
});
let output = '';
if (!config.get('verbose')) {
child.stdout.on('data', (data) => { output += data; });
child.stderr.on('data', (data) => { output += data; });
}
child.on('exit', (code) => {
if (code !== 0) return reject(code);
if (code !== 0) return reject(new Error(`Failed to install modules: ${JSON.stringify(deps)}\n\nWith output: ${output}`));
resolve();
});
});

0 comments on commit 20c0b12

Please sign in to comment.
You can’t perform that action at this time.