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 | |
| parent | 849fbf35af0eace236e40a159ede58bd76cff8a9 (diff) | |
#542 - multiple profile paths
| -rw-r--r-- | electron_js/main.js | 12 | ||||
| -rwxr-xr-x | make_desktop.sh | 14 | ||||
| -rw-r--r-- | package.json | 3 |
3 files changed, 20 insertions, 9 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. diff --git a/make_desktop.sh b/make_desktop.sh index 92a77916..7f12b941 100755 --- a/make_desktop.sh +++ b/make_desktop.sh @@ -16,7 +16,7 @@ APPVER=`cat config.xml | grep "widget " | sed 's/.* version=\"\([^\"]*\)\" xmlns APPVER+="D" echo "Application version:$APPVER" -declare -a app_ports=("desktop/zmNinja-mac.app/Contents/Resources" "desktop/zmNinja-linux32bit/resources" "desktop/zmNinja-linux64bit/resources" "desktop/zmNinja-win32-64bit/resources" "desktop/zmNinja-linuxarm/resources") +declare -a app_ports=("desktop/zmNinja-mac.app/Contents/Resources" "desktop/zmNinja-linux32bit/resources" "desktop/zmNinja-linux64bit/resources" "desktop/zmNinja-win32-x64bit/resources" "desktop/zmNinja-win32-ia32bit/resources" "desktop/zmNinja-linuxarm/resources") for i in "${app_ports[@]}" do @@ -35,10 +35,12 @@ if [ -d "$i" ]; then exe rm -fr $i/app exe mkdir $i/app exe mkdir $i/app/node_modules - exe cp -R node_modules/electron-window-state $i/app/node_modules - exe cp -R node_modules/jsonfile $i/app/node_modules - exe cp -R node_modules/mkdirp $i/app/node_modules - exe cp -R node_modules/deep-equal $i/app/node_modules + exe cp -R node_modules/electron-window-state $i/app/node_modules + exe cp -R node_modules/jsonfile $i/app/node_modules + exe cp -R node_modules/mkdirp $i/app/node_modules + exe cp -R node_modules/deep-equal $i/app/node_modules + exe cp -R node_modules/minimist $i/app/node_modules + exe cp -R www/* $i/app/ exe cp electron_js/* $i/app exe cp www/ZMNINJA-LICENSE-DESKTOP-CLIENT.txt $BASENAME @@ -52,7 +54,7 @@ if [ -d "$i" ]; then rm -fr app.asar exe asar pack app app.asar - exe rm -fr app + #exe rm -fr app exe cd - #OSX ditto does a better job than zip! #echo "Creating ZIP $ZIPNAME..." diff --git a/package.json b/package.json index 3450d047..bd461f1c 100644 --- a/package.json +++ b/package.json @@ -91,6 +91,7 @@ "electron-window-state": "^4.1.1", "ionic-plugin-keyboard": "^2.2.1", "json-file": "^0.1.0", + "minimist": "^1.2.0", "mkdirp": "^0.5.1", "org.devgeeks.Canvas2ImagePlugin": "https://github.com/flache/Canvas2ImagePlugin", "phonegap-plugin-mobile-accessibility": "^1.0.5", @@ -99,4 +100,4 @@ "devDependencies": { "bower": "^1.8.2" } -}
\ No newline at end of file +} |
