Don't quit on window-all-closed when in repl mode

This commit is contained in:
Kevin Sawicki 2016-03-22 13:37:57 -07:00
parent 832ac97088
commit 09710d6c47

View file

@ -9,12 +9,6 @@ const path = require('path');
const repl = require('repl');
const url = require('url');
// Quit when all windows are closed and no other one is listening to this.
app.on('window-all-closed', function() {
if (app.listeners('window-all-closed').length == 1)
app.quit();
});
// Parse command line options.
var argv = process.argv.slice(1);
var option = { file: null, help: null, version: null, webdriver: null, modules: [] };
@ -43,6 +37,12 @@ for (var i = 0; i < argv.length; i++) {
}
}
// Quit when all windows are closed and no other one is listening to this.
app.on('window-all-closed', function() {
if (app.listeners('window-all-closed').length == 1 && !option.interactive)
app.quit();
});
// Create default menu.
app.once('ready', function() {
if (Menu.getApplicationMenu())