UNPKG

439 BJavaScriptView Raw
1import { logger } from 'nightingale-app-console/src';
2import { stop as stopDisplay } from './commands/display';
3import { close as clientClose } from './client';
4import { childServer } from './fork-server';
5
6export function exit() {
7 logger.warn('exiting...');
8 Promise.all([childServer.kill(), stopDisplay(), clientClose()]).then(() => {
9 logger.warn('exit !');
10 process.exit();
11 });
12}
13
14process.on('SIGINT', () => {
15 exit();
16});