refactor query into yielding api
This commit is contained in:
parent
6bf8f60a45
commit
976a99baa1
5 changed files with 70 additions and 54 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue