Skip to content

Commit

Permalink
fix: crash on windows due to invalid signal
Browse files Browse the repository at this point in the history
windows only supports SIGINT and SIGBREAK
  • Loading branch information
JohannesRudolph committed Sep 24, 2023
1 parent 8d357c4 commit 32c1c23
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,13 @@ async function collie() {
// "long running" work is done by subprocesses anyway, there's nothing we need to do here but notifying the user
// that we wait for subprocesses to exit and then exiting ourselves.
Deno.addSignalListener("SIGINT", () => gracefulShutdown());
Deno.addSignalListener("SIGTERM", () => gracefulShutdown());

// not on windows
if (isWindows) {
Deno.addSignalListener("SIGBREAK", () => gracefulShutdown());
} else {
Deno.addSignalListener("SIGTERM", () => gracefulShutdown());
}

// Run the main program with error handling.
try {
Expand Down

0 comments on commit 32c1c23

Please sign in to comment.