Skip to content

Commit

Permalink
fix: resolve path for app.getPath for Windows
Browse files Browse the repository at this point in the history
closes #144
  • Loading branch information
pyphilia committed Jul 25, 2019
1 parent 3a0a300 commit 714cd5d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions public/app/config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,18 @@ const DOWNLOADABLE_MIME_TYPES = [
'application/pdf',
];

// resolve path for windows '\'
const resolvePath = str => {
return str.replace(/\\/g, '\\\\');
};

// categories
const RESOURCE = 'Resource';
const APPLICATION = 'Application';

const VAR_FOLDER = `${app.getPath('userData')}/var`;
const VAR_FOLDER = `${resolvePath(app.getPath('userData'))}/var`;
const DATABASE_PATH = `${VAR_FOLDER}/db.json`;
const ICON_PATH = `${app.getAppPath()}/assets/icon.png`;
const ICON_PATH = `${resolvePath(app.getAppPath())}/assets/icon.png`;
const PRODUCT_NAME = 'Graasp';
const TMP_FOLDER = 'tmp';
const DEFAULT_LANG = 'en';
Expand Down

0 comments on commit 714cd5d

Please sign in to comment.