skeleton code for loading configs into the client at init time
This commit is contained in:
parent
26bd2a3af9
commit
4e657e2710
@ -1,8 +1,18 @@
|
||||
const { ArgumentParser } = require('argparse')
|
||||
const { app, BrowserWindow } = require('electron')
|
||||
const path = require('path')
|
||||
const fs = require('fs')
|
||||
|
||||
let win;
|
||||
let config;
|
||||
|
||||
const parser = new ArgumentParser({
|
||||
description: 'Freechat Electron Client'
|
||||
})
|
||||
|
||||
parser.add_argument('-c', '--config', {help: 'Specify config path'})
|
||||
|
||||
console.log(parser.parse_args())
|
||||
function createWin() {
|
||||
let win = new BrowserWindow({
|
||||
width: 800,
|
||||
@ -25,6 +35,9 @@ function createWin() {
|
||||
});
|
||||
}
|
||||
|
||||
function load_config(config_path) {
|
||||
}
|
||||
|
||||
app.on('ready', createWin);
|
||||
|
||||
// on mac just because the windows are closed doesn't mean the application is too
|
||||
@ -38,6 +51,7 @@ app.on('window-all-closed', () => {
|
||||
app.on('activate', () => {
|
||||
if(win === null) {
|
||||
createWin();
|
||||
load_config('./example-dev-config.json'); // for now
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user