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