Electron 466: fix setting user data path using command line (#358)

- fix setting customer user config directory
- add code comments
- allow custom user data path to contain character "="
This commit is contained in:
Vishwas Shashidhar 2018-05-09 10:52:31 +05:30 committed by GitHub
parent 4092984298
commit 1739a25f22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -228,6 +228,16 @@ function setupThenOpenMainWindow() {
isAppAlreadyOpen = true;
getUrlAndCreateMainWindow();
// Allows a developer to set custom user data path from command line when
// launching the app. Mostly used for running automation tests with
// multiple instances
let customDataArg = getCmdLineArg(process.argv, '--userDataPath=', false);
let customDataFolder = customDataArg.substring(customDataArg.indexOf('=') + 1);
if (customDataArg && customDataFolder) {
app.setPath('userData', customDataFolder);
}
// Event that fixes the remote desktop issue in Windows
// by repositioning the browser window
electron.screen.on('display-removed', windowMgr.verifyDisplays);