diff options
author | Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com> | 2021-07-03 07:09:05 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-03 07:09:05 +0530 |
commit | 83676cec9ce8e41d5e88e7d06a17dd8194e3593e (patch) | |
tree | a73eb8b64a20530ee3c44f1901c9daa2a069f12a /src/index.js | |
parent | Update submodules, browserslist data updates and linter fixes [skip ci] (diff) | |
download | ferdium-app-83676cec9ce8e41d5e88e7d06a17dd8194e3593e.tar.gz ferdium-app-83676cec9ce8e41d5e88e7d06a17dd8194e3593e.tar.zst ferdium-app-83676cec9ce8e41d5e88e7d06a17dd8194e3593e.zip |
Minor refactoring to move all runtime configs from 'config.js' into 'environment.js'. (#1588)
Diffstat (limited to 'src/index.js')
-rw-r--r-- | src/index.js | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/src/index.js b/src/index.js index 21cf61c0c..d3b996540 100644 --- a/src/index.js +++ b/src/index.js | |||
@@ -16,35 +16,16 @@ import ms from 'ms'; | |||
16 | 16 | ||
17 | require('@electron/remote/main').initialize(); | 17 | require('@electron/remote/main').initialize(); |
18 | 18 | ||
19 | import { | 19 | import { DEFAULT_WINDOW_OPTIONS } from './config'; |
20 | DEFAULT_APP_SETTINGS, | ||
21 | DEFAULT_WINDOW_OPTIONS, | ||
22 | } from './config'; | ||
23 | 20 | ||
24 | import { | 21 | import { |
22 | DEFAULT_APP_SETTINGS, | ||
25 | isDevMode, | 23 | isDevMode, |
26 | isMac, | 24 | isMac, |
27 | isWindows, | 25 | isWindows, |
28 | isLinux, | 26 | isLinux, |
29 | } from './environment'; | 27 | } from './environment'; |
30 | 28 | ||
31 | // TODO: This seems to be duplicated between here and 'config.js' | ||
32 | // Set app directory before loading user modules | ||
33 | if (process.env.FERDI_APPDATA_DIR != null) { | ||
34 | app.setPath('appData', process.env.FERDI_APPDATA_DIR); | ||
35 | app.setPath('userData', path.join(app.getPath('appData'))); | ||
36 | } else if (process.env.PORTABLE_EXECUTABLE_DIR != null) { | ||
37 | app.setPath('appData', process.env.PORTABLE_EXECUTABLE_DIR, `${app.name}AppData`); | ||
38 | app.setPath('userData', path.join(app.getPath('appData'), `${app.name}AppData`)); | ||
39 | } else if (process.platform === 'win32') { | ||
40 | app.setPath('appData', process.env.APPDATA); | ||
41 | app.setPath('userData', path.join(app.getPath('appData'), app.name)); | ||
42 | } | ||
43 | |||
44 | if (isDevMode) { | ||
45 | app.setPath('userData', path.join(app.getPath('appData'), `${app.name}Dev`)); | ||
46 | } | ||
47 | |||
48 | import { mainIpcHandler as basicAuthHandler } from './features/basicAuth'; | 29 | import { mainIpcHandler as basicAuthHandler } from './features/basicAuth'; |
49 | import ipcApi from './electron/ipc-api'; | 30 | import ipcApi from './electron/ipc-api'; |
50 | import Tray from './lib/Tray'; | 31 | import Tray from './lib/Tray'; |