Skip to content

Commit

Permalink
fix: Ensure that the parent process exits when it exits
Browse files Browse the repository at this point in the history
  • Loading branch information
markthree committed Apr 13, 2023
1 parent 74e70f1 commit eec08f8
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@ export async function execa(cmd: string[]) {
stdout: "inherit",
})

let closed = false

function childExit() {
// No need to manually pass in signo
Deno.kill(process.pid)
Deno.close(process.rid)
if (!closed) {
// No need to manually pass in signo
Deno.kill(process.pid)
Deno.close(process.rid)
}
closed = true
}

// watch ctrl + c
Expand Down

0 comments on commit eec08f8

Please sign in to comment.