diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2017-09-28 20:30:34 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2017-09-28 20:30:34 -0400 |
| commit | b6fcd1b264856cedfacb9dec6e2348bdcfbb24cd (patch) | |
| tree | 134554a5b120c78cffca1ca0603743a2cb7a5362 /electron_js | |
| parent | 849fbf35af0eace236e40a159ede58bd76cff8a9 (diff) | |
#542 - multiple profile paths
Diffstat (limited to 'electron_js')
| -rw-r--r-- | electron_js/main.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/electron_js/main.js b/electron_js/main.js index 5493f823..84c2cb70 100644 --- a/electron_js/main.js +++ b/electron_js/main.js @@ -1,12 +1,20 @@ const electron = require('electron'); const windowStateKeeper = require('electron-window-state'); const {app, globalShortcut} = electron; +const {dialog} = require('electron') // Module to create native browser window. const {BrowserWindow} = electron; var isFs = false; +var argv = require('minimist')(process.argv.slice(2)); +if (argv.path) { + console.log ("PATH SET TO "+argv.path); + app.setPath("userData", argv.path); + console.log ("switching storage to: "+app.getPath("userData")); +} + @@ -59,7 +67,7 @@ const mx = globalShortcut.register('CommandOrControl+Alt+F', () => { mainWindowState.manage(win); // fs will be arg 1 if its not run in electron debug mode - if (process.argv.slice(1)=='fs' || process.argv.slice(2)=='fs') + if (argv.fs) { win.setFullScreen(true); isFs = true; @@ -108,7 +116,7 @@ app.on('activate', () => { app.on('uncaughtException', function (err) { console.log("***WHOOPS TIME****"+err); -}) +}); app.on('will-quit', () => { // Unregister all shortcuts. |
