include stdout in runSequence thrown error

This commit is contained in:
Wesley Wigham 2020-09-02 14:35:00 -07:00
parent 62a1b357c2
commit 3a75838cb7
No known key found for this signature in database
GPG Key ID: D59F87F60C5400C9

View File

@ -10,7 +10,7 @@ function runSequence(tasks, opts = { timeout: 100000, shell: true }) {
for (const task of tasks) {
console.log(`${task[0]} ${task[1].join(" ")}`);
const result = cp.spawnSync(task[0], task[1], opts);
if (result.status !== 0) throw new Error(`${task[0]} ${task[1].join(" ")} failed: ${result.stderr && result.stderr.toString()}`);
if (result.status !== 0) throw new Error(`${task[0]} ${task[1].join(" ")} failed: ${result.stderr && "stderr: " + result.stderr.toString()}${result.stdout && "\nstdout: " + result.stdout.toString()}`);
console.log(result.stdout && result.stdout.toString());
lastResult = result;
}