mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 20:26:24 +00:00
Refactor configuration out into reusable files
This commit is contained in:
committed by
Scott Nonnenberg
parent
ed831dacd0
commit
5e5ca80a6e
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;
|
||||
Reference in New Issue
Block a user