mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-12-31 19:27:00 -06:00
electron-113: fixes the issues raised by qa.
This commit is contained in:
parent
35177567ce
commit
55c3714b2b
@ -349,13 +349,17 @@ function clearCachedConfigs() {
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getConfigField,
|
||||
updateConfigField,
|
||||
|
||||
configFileName,
|
||||
|
||||
getConfigField,
|
||||
|
||||
updateConfigField,
|
||||
updateUserConfigWin,
|
||||
updateUserConfigMac,
|
||||
|
||||
// items below here are only exported for testing, do NOT use!
|
||||
saveUserConfig,
|
||||
clearCachedConfigs
|
||||
|
||||
};
|
44
js/main.js
44
js/main.js
@ -8,13 +8,8 @@ const squirrelStartup = require('electron-squirrel-startup');
|
||||
const AutoLaunch = require('auto-launch');
|
||||
const urlParser = require('url');
|
||||
|
||||
const childProcess = require('child_process');
|
||||
const path = require('path');
|
||||
const AppDirectory = require('appdirectory');
|
||||
const dirs = new AppDirectory('Symphony');
|
||||
|
||||
// Local Dependencies
|
||||
const { getConfigField } = require('./config.js');
|
||||
const {getConfigField, updateUserConfigWin, updateUserConfigMac} = require('./config.js');
|
||||
const { isMac, isDevEnv } = require('./utils/misc.js');
|
||||
const protocolHandler = require('./protocolHandler');
|
||||
const getCmdLineArg = require('./utils/getCmdLineArg.js');
|
||||
@ -178,43 +173,6 @@ function setStartup(lStartup) {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to overwrite user config on mac installer
|
||||
* @returns {Promise}
|
||||
*/
|
||||
function updateUserConfigMac() {
|
||||
return new Promise((resolve, reject) => {
|
||||
let userConfigPath = dirs.userConfig() + '/';
|
||||
let globalConfigPath = process.argv[2];
|
||||
let userName = process.env.USER;
|
||||
|
||||
childProcess.exec(`rsync -r "${globalConfigPath}" "${userConfigPath}" && chown -R "${userName}" "${userConfigPath}"`, {timeout: 60000}, (err) => {
|
||||
if (err) {
|
||||
reject(err);
|
||||
}
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to overwrite user config on windows installer
|
||||
* @returns {Promise}
|
||||
*/
|
||||
function updateUserConfigWin() {
|
||||
return new Promise((resolve, reject) => {
|
||||
let userConfigPath = app.getPath('userData');
|
||||
let globalConfigPath = path.join(__dirname, '..', '..', '..', 'config/Symphony.config');
|
||||
|
||||
childProcess.exec(`echo D|xcopy /y /e /s /c "${globalConfigPath}" "${userConfigPath}"`, {timeout: 60000}, (err) => {
|
||||
if (err) {
|
||||
reject(err);
|
||||
}
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks for the url argument, processes it
|
||||
* and creates the main window
|
||||
|
Loading…
Reference in New Issue
Block a user