TangJieHaoT
Denoβ€’2y agoβ€’
3 replies
TangJieHao

deno command stdin, stdout continous reading

I am trying to spawn an AI (cpp code) however after launching the code it immediately exits. It also isn't providing any stdout either.

relevant code:

async function load_kata_go(config) {
  const command = new Deno.Command(config.EXE, {
    args: ["analysis", "-model", config.MODEL, "-config", config.CONFIG],
    stdin: "piped",
    stdout: "piped",
    stderr: "piped",
  });

  const process = command.spawn();
  return process;
}

async function main() {
  const cli_kata_config = await load_cli_config();
  const katago = await load_kata_go(cli_kata_config);

  const result = await katago.output();
  console.log(new TextDecoder().decode(result.stdout));

  //command args
  //command settings
  //AI
  //analyze games
}

main();
Was this page helpful?