From 832ac970885b2ea7bfacf621e1448d25c336b7bf Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 22 Mar 2016 13:34:46 -0700 Subject: [PATCH] Exit process when repl exits --- default_app/main.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/default_app/main.js b/default_app/main.js index 18e39544ab8f..683dccaf3e16 100644 --- a/default_app/main.js +++ b/default_app/main.js @@ -278,6 +278,12 @@ function loadApplicationByUrl(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 default app. if (option.file && !option.webdriver) { @@ -312,7 +318,7 @@ if (option.file && !option.webdriver) { console.log(helpMessage); process.exit(0); } else if (option.interactive) { - repl.start('> '); + startRepl(); } else { loadApplicationByUrl('file://' + __dirname + '/index.html'); }