diff options
Diffstat (limited to 'src/index.js')
-rw-r--r-- | src/index.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/index.js b/src/index.js index fd96f8a49..3453b46f7 100644 --- a/src/index.js +++ b/src/index.js | |||
@@ -10,9 +10,14 @@ import path from 'path'; | |||
10 | import windowStateKeeper from 'electron-window-state'; | 10 | import windowStateKeeper from 'electron-window-state'; |
11 | 11 | ||
12 | // Set app directory before loading user modules | 12 | // Set app directory before loading user modules |
13 | if (process.env.FERDI_APPDATA_DIR || process.env.PORTABLE_EXECUTABLE_DIR) { | 13 | if (process.env.FERDI_APPDATA_DIR != null) { |
14 | const appDataPath = process.env.FERDI_APPDATA_DIR || process.env.PORTABLE_EXECUTABLE_DIR | 14 | app.setPath('appData', process.env.FERDI_APPDATA_DIR); |
15 | app.setPath('appData', appDataPath); | 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); | ||
16 | app.setPath('userData', path.join(app.getPath('appData'), app.getName())); | 21 | app.setPath('userData', path.join(app.getPath('appData'), app.getName())); |
17 | } | 22 | } |
18 | 23 | ||