aboutsummaryrefslogtreecommitdiffstats
path: root/src/index.js
diff options
context:
space:
mode:
authorLibravatar Makazzz <makazzzpro@live.ca>2019-10-29 15:06:56 -0400
committerLibravatar Makazzz <makazzzpro@live.ca>2019-10-29 15:06:56 -0400
commit4b69f1d1047efc64705e08ffbb363643147d7206 (patch)
tree33a6a3458088949fb5acbc4646414509f62bec44 /src/index.js
parentCreating function instead (diff)
downloadferdium-app-4b69f1d1047efc64705e08ffbb363643147d7206.tar.gz
ferdium-app-4b69f1d1047efc64705e08ffbb363643147d7206.tar.zst
ferdium-app-4b69f1d1047efc64705e08ffbb363643147d7206.zip
Revert to 93e718a
Diffstat (limited to 'src/index.js')
-rw-r--r--src/index.js14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/index.js b/src/index.js
index 8d52e5396..3453b46f7 100644
--- a/src/index.js
+++ b/src/index.js
@@ -9,9 +9,17 @@ import fs from 'fs-extra';
9import path from 'path'; 9import path from 'path';
10import windowStateKeeper from 'electron-window-state'; 10import windowStateKeeper from 'electron-window-state';
11 11
12import { portable } from './helpers/portable-helpers'; 12// Set app directory before loading user modules
13 13if (process.env.FERDI_APPDATA_DIR != null) {
14portable(); 14 app.setPath('appData', process.env.FERDI_APPDATA_DIR);
15 app.setPath('userData', path.join(app.getPath('appData')));
16} else if (process.env.PORTABLE_EXECUTABLE_DIR != null) {
17 app.setPath('appData', process.env.PORTABLE_EXECUTABLE_DIR, `${app.getName()}AppData`);
18 app.setPath('userData', path.join(app.getPath('appData'), `${app.getName()}AppData`));
19} else if (process.platform === 'win32') {
20 app.setPath('appData', process.env.APPDATA);
21 app.setPath('userData', path.join(app.getPath('appData'), app.getName()));
22}
15 23
16if (isDevMode) { 24if (isDevMode) {
17 app.setPath('userData', path.join(app.getPath('appData'), `${app.getName()}Dev`)); 25 app.setPath('userData', path.join(app.getPath('appData'), `${app.getName()}Dev`));