refactor query into yielding api

This commit is contained in:
Matthieu Jolimaitre 2024-04-10 02:45:34 +02:00
parent 6bf8f60a45
commit 976a99baa1
5 changed files with 70 additions and 54 deletions

View file

@ -257,7 +257,7 @@ export function wait(ms: number) {
}
export async function run(cmd: string, ...args: string[]) {
const command = new Deno.Command(cmd, { args, stdout: "piped" });
const command = new Deno.Command(cmd, { args, stdin: "inherit", stdout: "piped" });
const output = await command.output();
if (!output.success) throw new Error();
return new TextDecoder().decode(output.stdout);