Exit process when repl exits
This commit is contained in:
parent
8685f8e6c8
commit
832ac97088
1 changed files with 7 additions and 1 deletions
|
@ -278,6 +278,12 @@ function loadApplicationByUrl(appUrl) {
|
||||||
require('./default_app').load(appUrl);
|
require('./default_app').load(appUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function startRepl() {
|
||||||
|
repl.start('> ').on('exit', function() {
|
||||||
|
process.exit(0);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Start the specified app if there is one specified in command line, otherwise
|
// Start the specified app if there is one specified in command line, otherwise
|
||||||
// start the default app.
|
// start the default app.
|
||||||
if (option.file && !option.webdriver) {
|
if (option.file && !option.webdriver) {
|
||||||
|
@ -312,7 +318,7 @@ if (option.file && !option.webdriver) {
|
||||||
console.log(helpMessage);
|
console.log(helpMessage);
|
||||||
process.exit(0);
|
process.exit(0);
|
||||||
} else if (option.interactive) {
|
} else if (option.interactive) {
|
||||||
repl.start('> ');
|
startRepl();
|
||||||
} else {
|
} else {
|
||||||
loadApplicationByUrl('file://' + __dirname + '/index.html');
|
loadApplicationByUrl('file://' + __dirname + '/index.html');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue