mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-01-05 21:54:05 -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 = {
|
module.exports = {
|
||||||
getConfigField,
|
|
||||||
updateConfigField,
|
|
||||||
configFileName,
|
configFileName,
|
||||||
|
|
||||||
|
getConfigField,
|
||||||
|
|
||||||
|
updateConfigField,
|
||||||
updateUserConfigWin,
|
updateUserConfigWin,
|
||||||
updateUserConfigMac,
|
updateUserConfigMac,
|
||||||
|
|
||||||
// items below here are only exported for testing, do NOT use!
|
// items below here are only exported for testing, do NOT use!
|
||||||
saveUserConfig,
|
saveUserConfig,
|
||||||
clearCachedConfigs
|
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 AutoLaunch = require('auto-launch');
|
||||||
const urlParser = require('url');
|
const urlParser = require('url');
|
||||||
|
|
||||||
const childProcess = require('child_process');
|
|
||||||
const path = require('path');
|
|
||||||
const AppDirectory = require('appdirectory');
|
|
||||||
const dirs = new AppDirectory('Symphony');
|
|
||||||
|
|
||||||
// Local Dependencies
|
// Local Dependencies
|
||||||
const { getConfigField } = require('./config.js');
|
const {getConfigField, updateUserConfigWin, updateUserConfigMac} = require('./config.js');
|
||||||
const { isMac, isDevEnv } = require('./utils/misc.js');
|
const { isMac, isDevEnv } = require('./utils/misc.js');
|
||||||
const protocolHandler = require('./protocolHandler');
|
const protocolHandler = require('./protocolHandler');
|
||||||
const getCmdLineArg = require('./utils/getCmdLineArg.js');
|
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
|
* Checks for the url argument, processes it
|
||||||
* and creates the main window
|
* and creates the main window
|
||||||
|
Loading…
Reference in New Issue
Block a user