mirror of
https://github.com/lifegpc/eh-downloader.git
synced 2026-06-06 05:38:44 +08:00
Add Ctrl + C support
This commit is contained in:
8
signal_handler.ts
Normal file
8
signal_handler.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { TaskManager } from "./task_manager.ts";
|
||||
|
||||
export function add_exit_handler(m: TaskManager) {
|
||||
const handler = () => {
|
||||
m.close();
|
||||
};
|
||||
Deno.addSignalListener("SIGINT", handler);
|
||||
}
|
||||
Reference in New Issue
Block a user