diff options
author | 2019-10-29 14:45:00 -0400 | |
---|---|---|
committer | 2019-10-29 14:45:00 -0400 | |
commit | 62f30ccd4c430213860da36d52de793cfcfd293a (patch) | |
tree | 0b790b68f59ca76d1719f21e46b705d22c933f05 /src/index.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/index.js')
-rw-r--r-- | src/index.js | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/index.js b/src/index.js index 3453b46f7..8d52e5396 100644 --- a/src/index.js +++ b/src/index.js | |||
@@ -9,17 +9,9 @@ import fs from 'fs-extra'; | |||
9 | import path from 'path'; | 9 | 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 | import { portable } from './helpers/portable-helpers'; |
13 | if (process.env.FERDI_APPDATA_DIR != null) { | 13 | |
14 | app.setPath('appData', process.env.FERDI_APPDATA_DIR); | 14 | portable(); |
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 | } | ||
23 | 15 | ||
24 | if (isDevMode) { | 16 | if (isDevMode) { |
25 | app.setPath('userData', path.join(app.getPath('appData'), `${app.getName()}Dev`)); | 17 | app.setPath('userData', path.join(app.getPath('appData'), `${app.getName()}Dev`)); |