feat: added exit handler

pull/243/head
Josh Moore 1 year ago
parent 4169c3525f
commit 25fe92ffe0

@ -95,3 +95,14 @@ log.blank()
// Start program
main().catch(() => process.exit(1));
// Exit tasks
['SIGINT', 'SIGTERM'].forEach((signal) => process.addListener(signal as any, () => {
// Hide ^C in console output
process.stdout.write('\r');
// Log then exit
log.info('Exiting', `received ${signal}`);
process.exit();
}));

Loading…
Cancel
Save