Skip to content

Commit

Permalink
Get stderr data
Browse files Browse the repository at this point in the history
  • Loading branch information
DiegoVictor committed Oct 23, 2024
1 parent ba82b59 commit 890f949
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions container/src/common/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ const command = async (cmd, args) => {
chunks.push(data);
});

cli.stderr.on("data", (data) => {
chunks.push(data);
});

cli.stdout.on("close", () => {
const response = Buffer.concat(chunks).toString("utf8");
resolve(response);
Expand Down
2 changes: 1 addition & 1 deletion container/src/use-cases/run-go.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const main = async ({ code, inputs }) => {
await writeFile(filename, challenge);

const result = await command("go", ["run", filename, JSON.stringify(inputs)]);
console.log("result", result);
console.log(result);

return JSON.parse(result.replace(/\n/, ""));
};
Expand Down

0 comments on commit 890f949

Please sign in to comment.