Skip to content

Commit

Permalink
chore(initializer): output logs of the install step on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshallOfSound authored and malept committed Dec 11, 2016
1 parent f6f9664 commit 20c0b12
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/util/install-dependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
});
Expand Down

0 comments on commit 20c0b12

Please sign in to comment.