diff options
Diffstat (limited to 'tools/flamebench.js')
-rwxr-xr-x | tools/flamebench.js | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/tools/flamebench.js b/tools/flamebench.js index 35f739e1e..5293fa9a1 100755 --- a/tools/flamebench.js +++ b/tools/flamebench.js @@ -3,35 +3,34 @@ import { join, ROOT_PATH as ROOT } from "./util.js"; async function bashOut(subcmd) { - const p = Deno.run({ - cmd: ["bash", "-c", subcmd], + const { status, stdout } = await Deno.spawn("bash", { + args: ["-c", subcmd], stdout: "piped", stderr: "null", }); // Check for failure - const { success } = await p.status(); - if (!success) { + if (!status.success) { throw new Error("subcmd failed"); } // Gather output - const output = new TextDecoder().decode(await p.output()); - // Cleanup - p.close(); + const output = new TextDecoder().decode(stdout); return output.trim(); } async function bashThrough(subcmd, opts = {}) { - const p = Deno.run({ ...opts, cmd: ["bash", "-c", subcmd] }); + const { status } = await Deno.spawn("bash", { + ...opts, + args: ["-c", subcmd], + stdout: "inherit", + stderr: "inherit", + }); // Exit process on failure - const { success, code } = await p.status(); - if (!success) { - Deno.exit(code); + if (!status.success) { + Deno.exit(status.code); } - // Cleanup - p.close(); } async function availableBenches() { |