Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit dd4dff5

Browse files
committedNov 16, 2020
fix(core): store terminal output for failed tasks created with pipe output capture
1 parent 017348b commit dd4dff5

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed
 

‎packages/workspace/src/tasks-runner/task-orchestrator.ts

+15-10
Original file line numberDiff line numberDiff line change
@@ -185,17 +185,22 @@ export class TaskOrchestrator {
185185
output.logCommand(commandLine);
186186
process.stdout.write(outWithErr.join(''));
187187
}
188-
if (outputPath && code === 0) {
188+
if (outputPath) {
189189
fs.writeFileSync(outputPath, outWithErr.join(''));
190-
this.cache
191-
.put(task, outputPath, taskOutputs)
192-
.then(() => {
193-
this.options.lifeCycle.endTask(task, code);
194-
res(code);
195-
})
196-
.catch((e) => {
197-
rej(e);
198-
});
190+
if (code === 0) {
191+
this.cache
192+
.put(task, outputPath, taskOutputs)
193+
.then(() => {
194+
this.options.lifeCycle.endTask(task, code);
195+
res(code);
196+
})
197+
.catch((e) => {
198+
rej(e);
199+
});
200+
} else {
201+
this.options.lifeCycle.endTask(task, code);
202+
res(code);
203+
}
199204
} else {
200205
this.options.lifeCycle.endTask(task, code);
201206
res(code);

0 commit comments

Comments
 (0)
Please sign in to comment.