Skip to content

Commit 32c1c23

Browse files
fix: crash on windows due to invalid signal
windows only supports SIGINT and SIGBREAK
1 parent 8d357c4 commit 32c1c23

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/main.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,13 @@ async function collie() {
5151
// "long running" work is done by subprocesses anyway, there's nothing we need to do here but notifying the user
5252
// that we wait for subprocesses to exit and then exiting ourselves.
5353
Deno.addSignalListener("SIGINT", () => gracefulShutdown());
54-
Deno.addSignalListener("SIGTERM", () => gracefulShutdown());
54+
55+
// not on windows
56+
if (isWindows) {
57+
Deno.addSignalListener("SIGBREAK", () => gracefulShutdown());
58+
} else {
59+
Deno.addSignalListener("SIGTERM", () => gracefulShutdown());
60+
}
5561

5662
// Run the main program with error handling.
5763
try {

0 commit comments

Comments
 (0)