Skip to content
This repository has been archived by the owner on Apr 6, 2024. It is now read-only.

Commit

Permalink
Trying to fix #48 (error in main process on linux)
Browse files Browse the repository at this point in the history
  • Loading branch information
Malte311 committed Nov 22, 2018
1 parent 1fc5617 commit ca389e6
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
12 changes: 11 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@
"dependencies": {
"chart.js": "^2.7.3",
"compare-versions": "^3.4.0",
"electron-is-dev": "^1.0.1",
"electron-json-storage": "^4.1.0",
"jquery": "^3.3.1",
"os": "^0.1.1",
"path": "^0.12.7",
"request": "^2.88.0"
}
Expand Down
9 changes: 8 additions & 1 deletion scripts/JSONhandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const fs = require( 'fs' );
const storage = require( 'electron-json-storage' );
// We use this module to get the correct path seperator (only needed to display it correctly).
const path = require( 'path' );
const os = require( 'os' );
// A default settings.json object.
const defaultObj = {"windowSize":"1920x1080","fullscreen":false,"language":"en",
"path": storage.getDefaultDataPath() + path.sep + "data",
Expand Down Expand Up @@ -72,7 +73,13 @@ function initStorage() {
* This function creates missing paths.
*/
function createPath( newPath ) {
var start = "";
var start;
if ( os.platfrom() === "win32" ) {
start = "";
}
else {
start = "/";
}
newPath.split( path.sep ).forEach( function ( folder ) {
if ( folder.length > 0 ) {
start += folder + path.sep;
Expand Down
8 changes: 5 additions & 3 deletions scripts/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
* @author Malte311
*/

const isDev = require('electron-is-dev');

module.exports = {
// Devtools on?
devMode : false,
log : true,
updateNeeded : true
devMode : isDev,
log : false,
updateNeeded : false
}

0 comments on commit ca389e6

Please sign in to comment.