From b5c0dd4acc02c18375b22fcbcd27d3acd81fb39d Mon Sep 17 00:00:00 2001 From: DiegoVictor Date: Wed, 23 Oct 2024 20:01:18 -0300 Subject: [PATCH] Show executed command --- container/src/common/command.js | 1 + container/src/use-cases/run-go.js | 1 + 2 files changed, 2 insertions(+) diff --git a/container/src/common/command.js b/container/src/common/command.js index d4aab68..ff6bc07 100644 --- a/container/src/common/command.js +++ b/container/src/common/command.js @@ -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) => { diff --git a/container/src/use-cases/run-go.js b/container/src/use-cases/run-go.js index 76c0625..2d8db80 100644 --- a/container/src/use-cases/run-go.js +++ b/container/src/use-cases/run-go.js @@ -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);