Refactor configuration out into reusable files
This commit is contained in:
parent
ed831dacd0
commit
5e5ca80a6e
4 changed files with 84 additions and 55 deletions
22
app/user_config.js
Normal file
22
app/user_config.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
const app = require('electron').app;
|
||||
const path = require('path');
|
||||
const ElectronConfig = require('electron-config');
|
||||
|
||||
const config = require('./config');
|
||||
|
||||
// use a separate data directory for development
|
||||
if (config.has('storageProfile')) {
|
||||
const userData = path.join(
|
||||
app.getPath('appData'),
|
||||
'Signal-' + config.get('storageProfile')
|
||||
);
|
||||
|
||||
app.setPath('userData', userData);
|
||||
}
|
||||
|
||||
console.log('userData ' + app.getPath('userData'));
|
||||
|
||||
// this needs to be below our update to the appData path
|
||||
const userConfig = new ElectronConfig();
|
||||
|
||||
module.exports = userConfig;
|
Loading…
Add table
Add a link
Reference in a new issue