From 0066833887aba619fd2f91e6462a9b001c54fa47 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 22 Mar 2016 13:22:39 -0700 Subject: [PATCH] Add repl CLI option --- default_app/main.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/default_app/main.js b/default_app/main.js index 6ff26e9ea679..e0e41235eaa6 100644 --- a/default_app/main.js +++ b/default_app/main.js @@ -6,6 +6,7 @@ const Menu = electron.Menu; const fs = require('fs'); 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. @@ -27,6 +28,8 @@ for (var i = 0; i < argv.length; i++) { } else if (argv[i] == '--help' || argv[i] == '-h') { option.help = true; break; + } else if (argv[i] == '--interactive' || argv[i] == '-i') { + option.interactive = true; } else if (argv[i] == '--test-type=webdriver') { option.webdriver = true; } else if (argv[i] == '--require' || argv[i] == '-r') { @@ -307,6 +310,8 @@ if (option.file && !option.webdriver) { helpMessage += " -v, --version Print the version."; console.log(helpMessage); process.exit(0); +} else if (option.interactive) { + repl.start('> '); } else { loadApplicationByUrl('file://' + __dirname + '/index.html'); }