Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions scully/watchMode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {loadConfig} from './utils/config';
import {checkChangeAngular} from './utils/fsAngular';
import {checkStaticFolder} from './utils/fsFolder';
import {httpGetJson} from './utils/httpGetJson';
import {log, logError, yellow, green} from './utils/log';
import {log, logError, yellow, green, logWarn} from './utils/log';
import {closeExpress, staticServer} from './utils/staticServer';

export async function bootServe(scullyConfig: ScullyConfig) {
Expand Down Expand Up @@ -45,14 +45,21 @@ export function checkForManualRestart() {
output: process.stdout,
});

readline.question(``, command => {
readline.question(``, async command => {
if (command.toLowerCase() === 'r') {
startScully().then(() => {
readline.close();
checkForManualRestart();
});
} else if (command.toLowerCase() === 'q') {
await httpGetJson(`http://${scullyConfig.hostName}:${scullyConfig.appPort}/killMe`, {
suppressErrors: true,
}).catch(e => e);
await httpGetJson(`https://${scullyConfig.hostName}:${scullyConfig.appPort}/killMe`, {
suppressErrors: true,
}).catch(e => e);
process.exit(0);
return;
} else {
log(`${yellow('------------------------------------------------------------')}`);
log(`Press ${green('r')} for re-run Scully, or ${green('q')} for close the servers.`);
Expand Down