Add repl CLI option
This commit is contained in:
parent
4a1e060832
commit
0066833887
1 changed files with 5 additions and 0 deletions
|
@ -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');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue