Skip to content

Commit

Permalink
Show executed command
Browse files Browse the repository at this point in the history
  • Loading branch information
DiegoVictor committed Oct 23, 2024
1 parent d2e553a commit b5c0dd4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions container/src/common/command.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const { spawn } = require("node:child_process");

const command = async (cmd, args) => {
console.log(`${cmd} ${args.join(" ")}`);
const cli = spawn(cmd, args);

return new Promise((resolve) => {
Expand Down
1 change: 1 addition & 0 deletions container/src/use-cases/run-go.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const main = async ({ code, inputs }) => {
const filename = `/tmp/${runId}.go`;
await writeFile(filename, challenge);

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

Expand Down

0 comments on commit b5c0dd4

Please sign in to comment.