Move everything to core

This commit is contained in:
MindfulMinun committed 2022-07-26 01:41:08 -05:00
1 parent ad223ef14b
commit 7119ee6873
7 files changed
+2 -2

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
/**
* Run a shell command that can be aborted using an `AbortSignal`
* @since 2021-08-13
*/
export async function abortableExec(opts: { cmd: string[], signal?: AbortSignal }): Promise<void> {
const { cmd, signal } = opts
if (signal && signal.aborted) return
const p = Deno.run({
cmd,
stdout: "null"
})
signal && signal.addEventListener('abort', () => p.kill("SIGINT"))
await p.status()
return
}