Skip to content

Commit

Permalink
fix: log on standalone failures
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Muller committed Nov 4, 2020
1 parent a69c6cd commit ac4989d
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion packages/typescript/internal/worker/worker_adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,25 @@ async function main() {
`Started a new process to perform this action. Your build might be misconfigured, try
--strategy=${MNEMONIC}=worker`);

child.on('exit', code => process.exit(code));
const stdoutbuffer = [];
child.stdout.on('data', data => stdoutbuffer.push(data));

const stderrbuffer = [];
child.stderr.on('data', data => stderrbuffer.push(data));

child.on('exit', code => {
if (code !== 0) {
console.error(
`\nstdout from tsc:\n\n ${
stdoutbuffer.map(s => s.toString()).join('').replace(/\n/g, '\n ')}`,
)
console.error(
`\nstderr from tsc:\n\n ${
stderrbuffer.map(s => s.toString()).join('').replace(/\n/g, '\n ')}`,
)
}
process.exit(code)
});
}
}

Expand Down

0 comments on commit ac4989d

Please sign in to comment.