Split configuration into low and high traffic files

Also, we're now handling config ourselves instead of using
electron-config and config dependencies.
This commit is contained in:
Scott Nonnenberg 2018-08-28 14:53:05 -07:00
parent f59ec92fef
commit 998c35dcb3
9 changed files with 112 additions and 103 deletions

View file

@ -1,11 +1,11 @@
const path = require('path');
const { app } = require('electron');
const ElectronConfig = require('electron-config');
const { start } = require('./base_config');
const config = require('./config');
// use a separate data directory for development
// Use separate data directory for development
if (config.has('storageProfile')) {
const userData = path.join(
app.getPath('appData'),
@ -17,7 +17,9 @@ if (config.has('storageProfile')) {
console.log(`userData: ${app.getPath('userData')}`);
// this needs to be below our update to the appData path
const userConfig = new ElectronConfig();
const userDataPath = app.getPath('userData');
const targetPath = path.join(userDataPath, 'config.json');
const userConfig = start('user', targetPath);
module.exports = userConfig;