Add --config-file=FILE
option for testing
This commit is contained in:
11
src/main.js
11
src/main.js
@@ -10,14 +10,23 @@ const fs = require('fs');
|
||||
|
||||
var appMenu = require('./menus/app');
|
||||
|
||||
var argv = require('yargs').argv;
|
||||
|
||||
var client = null;
|
||||
if (process.argv.indexOf('--livereload') > 0) {
|
||||
if (argv.livereload) {
|
||||
client = require('electron-connect').client.create();
|
||||
client.on('stop', function() {
|
||||
app.quit();
|
||||
});
|
||||
}
|
||||
|
||||
if (argv['config-file']) {
|
||||
global['config-file'] = argv['config-file'];
|
||||
}
|
||||
else {
|
||||
global['config-file'] = app.getPath('userData') + '/config.json'
|
||||
}
|
||||
|
||||
// Keep a global reference of the window object, if you don't, the window will
|
||||
// be closed automatically when the JavaScript object is garbage collected.
|
||||
var mainWindow = null;
|
||||
|
Reference in New Issue
Block a user