Skip to content

Commit

Permalink
chore: rename identifier
Browse files Browse the repository at this point in the history
  • Loading branch information
markthree committed Jun 11, 2023
1 parent 4c93c4e commit 2c1330f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ export async function execa(cmd: string[], options: Deno.CommandOptions = {}) {

let resolved = false
const process = commander.spawn()
const removeShutdownEvent = gracefulShutdown(() => {
const ensureCleanEvents = gracefulShutdown(() => {
if (!resolved) {
process.kill()
resolved = true
}
})
const { success, code } = await process.status
resolved = true
removeShutdownEvent()
ensureCleanEvents()
if (!success) {
Deno.exit(code)
}
Expand Down Expand Up @@ -75,7 +75,7 @@ export function gracefulShutdown(

Deno.addSignalListener("SIGINT", exitWithShoutdown)

return function removeShutdownEvent() {
return function ensureCleanEvents() {
globalThis.removeEventListener("error", shutdown)
globalThis.removeEventListener("unload", shutdown)
globalThis.removeEventListener("unhandledrejection", shutdown)
Expand Down

0 comments on commit 2c1330f

Please sign in to comment.