diff options
author | Makazzz <makazzzpro@live.ca> | 2019-10-29 14:45:00 -0400 |
---|---|---|
committer | Makazzz <makazzzpro@live.ca> | 2019-10-29 14:45:00 -0400 |
commit | 62f30ccd4c430213860da36d52de793cfcfd293a (patch) | |
tree | 0b790b68f59ca76d1719f21e46b705d22c933f05 /src/config.js | |
parent | Add portable dir (diff) | |
download | ferdium-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.js | 14 |
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 | ||
114 | export const LOCAL_SERVER = 'You are using Ferdi without a server'; | 114 | export const LOCAL_SERVER = 'You are using Ferdi without a server'; |
115 | 115 | ||
116 | // Set app directory before loading user modules | 116 | import { portable } from './helpers/portable-helpers'; |
117 | if (process.env.FERDI_APPDATA_DIR != null) { | 117 | |
118 | app.setPath('appData', process.env.FERDI_APPDATA_DIR); | 118 | portable(); |
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 | ||
128 | export const SETTINGS_PATH = path.join(app.getPath('userData'), 'config'); | 120 | export const SETTINGS_PATH = path.join(app.getPath('userData'), 'config'); |
129 | 121 | ||