diff options
author | 2019-10-18 08:31:51 +0700 | |
---|---|---|
committer | 2019-10-18 08:31:51 +0700 | |
commit | d135ab36e8bb7849888bd891ecc4b3b20115f8a7 (patch) | |
tree | 78ce56e02906e6f9178baac930b492c5de296415 /src/index.js | |
parent | New Crowdin translations (#125) (diff) | |
download | ferdium-app-d135ab36e8bb7849888bd891ecc4b3b20115f8a7.tar.gz ferdium-app-d135ab36e8bb7849888bd891ecc4b3b20115f8a7.tar.zst ferdium-app-d135ab36e8bb7849888bd891ecc4b3b20115f8a7.zip |
#87 Explicitly set both appData and userData
Diffstat (limited to 'src/index.js')
-rw-r--r-- | src/index.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/index.js b/src/index.js index 4dcabb599..799e762f5 100644 --- a/src/index.js +++ b/src/index.js | |||
@@ -10,10 +10,10 @@ 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 != null) { | 13 | if (process.env.FERDI_APPDATA_DIR || process.env.PORTABLE_EXECUTABLE_DIR) { |
14 | app.setPath('appData', process.env.FERDI_APPDATA_DIR); | 14 | const appDataPath = process.env.FERDI_APPDATA_DIR || process.env.PORTABLE_EXECUTABLE_DIR |
15 | } else if (process.env.PORTABLE_EXECUTABLE_DIR != null) { | 15 | app.setPath('appData', appDataPath); |
16 | app.setPath('appData', process.env.PORTABLE_EXECUTABLE_DIR); | 16 | app.setPath('userData', path.join(app.getPath('appData'), app.getName())); |
17 | } | 17 | } |
18 | if (isDevMode) { | 18 | if (isDevMode) { |
19 | app.setPath('userData', path.join(app.getPath('appData'), `${app.getName()}Dev`)); | 19 | app.setPath('userData', path.join(app.getPath('appData'), `${app.getName()}Dev`)); |