aboutsummaryrefslogtreecommitdiffstats
path: root/src/config.js
diff options
context:
space:
mode:
authorLibravatar Makazzz <makazzzpro@live.ca>2019-10-29 14:45:00 -0400
committerLibravatar Makazzz <makazzzpro@live.ca>2019-10-29 14:45:00 -0400
commit62f30ccd4c430213860da36d52de793cfcfd293a (patch)
tree0b790b68f59ca76d1719f21e46b705d22c933f05 /src/config.js
parentAdd portable dir (diff)
downloadferdium-app-62f30ccd4c430213860da36d52de793cfcfd293a.tar.gz
ferdium-app-62f30ccd4c430213860da36d52de793cfcfd293a.tar.zst
ferdium-app-62f30ccd4c430213860da36d52de793cfcfd293a.zip
Creating function instead
Diffstat (limited to 'src/config.js')
-rw-r--r--src/config.js14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/config.js b/src/config.js
index a7389b8bc..33067fc9d 100644
--- a/src/config.js
+++ b/src/config.js
@@ -113,17 +113,9 @@ export const FILE_SYSTEM_SETTINGS_TYPES = [
113 113
114export const LOCAL_SERVER = 'You are using Ferdi without a server'; 114export const LOCAL_SERVER = 'You are using Ferdi without a server';
115 115
116// Set app directory before loading user modules 116import { portable } from './helpers/portable-helpers';
117if (process.env.FERDI_APPDATA_DIR != null) { 117
118 app.setPath('appData', process.env.FERDI_APPDATA_DIR); 118portable();
119 app.setPath('userData', path.join(app.getPath('appData')));
120} else if (process.env.PORTABLE_EXECUTABLE_DIR != null) {
121 app.setPath('appData', process.env.PORTABLE_EXECUTABLE_DIR, `${app.getName()}AppData`);
122 app.setPath('userData', path.join(app.getPath('appData'), `${app.getName()}AppData`));
123} else if (process.platform === 'win32') {
124 app.setPath('appData', process.env.APPDATA);
125 app.setPath('userData', path.join(app.getPath('appData'), app.getName()));
126}
127 119
128export const SETTINGS_PATH = path.join(app.getPath('userData'), 'config'); 120export const SETTINGS_PATH = path.join(app.getPath('userData'), 'config');
129 121