Skip to content

Commit

Permalink
Fixed WORKSPACE path leaking
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinTree committed Mar 5, 2019
1 parent aa64ab8 commit 076271c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,10 @@ class Builder {
JobPool.get(jobId).status = JobStatus.failed;
if (reason instanceof ExecError) {
let err = <ExecError> reason;
JobPool.get(jobId).attachInfo("failInfo", err.message + ": code(" + err.code + ") stdout:\n" + err.stdout + "\n\nstderr:\n" + err.stderr);
// Notice that it would not work on windows
let stdout = err.stdout.split(WORKSPACE).join("%SERVER_WORKSPACE%/");
let stderr = err.stderr.split(WORKSPACE).join("%SERVER_WORKSPACE%/");
JobPool.get(jobId).attachInfo("failInfo", err.message + ": code(" + err.code + ") stdout:\n" + stdout + "\n\nstderr:\n" + stderr);
} else {
JobPool.get(jobId).attachInfo("failInfo", reason);
}
Expand Down
6 changes: 5 additions & 1 deletion static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
if (xhr.responseJSON.status == "done") {
callback_whenDone();
} else {
if (xhr.responseJSON.status != "failed") {
if (xhr.responseJSON.status == "failed") {
$("#output").text(xhr.responseJSON.failInfo);
} else {
checkStatus(jobId, callback_whenDone, times + 1);
}
}
Expand Down Expand Up @@ -133,6 +135,8 @@
Status: <label id="status"></label>
</p>

<pre id="output"></pre>

<p style="display: none;">
<a id="download" target="_blank">Download</a>
</p>
Expand Down

0 comments on commit 076271c

Please sign in to comment.