diff options
author | Makazzz <makazzzpro@live.ca> | 2019-10-26 13:27:16 -0400 |
---|---|---|
committer | Makazzz <makazzzpro@live.ca> | 2019-10-26 13:27:16 -0400 |
commit | 478475f96436ac7a7c8fbf7cf6a1f7b7ace4fd82 (patch) | |
tree | ad8cab6c39080ec0ca90caf4d12471f18fe788bc /src | |
parent | Fix lint (diff) | |
download | ferdium-app-478475f96436ac7a7c8fbf7cf6a1f7b7ace4fd82.tar.gz ferdium-app-478475f96436ac7a7c8fbf7cf6a1f7b7ace4fd82.tar.zst ferdium-app-478475f96436ac7a7c8fbf7cf6a1f7b7ace4fd82.zip |
Change appData env
Diffstat (limited to 'src')
-rw-r--r-- | src/config.js | 3 | ||||
-rw-r--r-- | src/index.js | 8 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/config.js b/src/config.js index 761d26eea..ad4fc6165 100644 --- a/src/config.js +++ b/src/config.js | |||
@@ -113,7 +113,8 @@ 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 | export const SETTINGS_PATH = path.join(app.getPath('userData'), 'config'); | 116 | // export const SETTINGS_PATH = path.join(app.getPath('userData'), 'config'); |
117 | export const SETTINGS_PATH = path.join(app.getPath('appData'), 'config'); | ||
117 | 118 | ||
118 | // Replacing app.asar is not beautiful but unforunately necessary | 119 | // Replacing app.asar is not beautiful but unforunately necessary |
119 | export const RECIPES_PATH = asarPath(path.join(__dirname, 'recipes')); | 120 | export const RECIPES_PATH = asarPath(path.join(__dirname, 'recipes')); |
diff --git a/src/index.js b/src/index.js index 87aa6357b..edcea2049 100644 --- a/src/index.js +++ b/src/index.js | |||
@@ -9,9 +9,11 @@ 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 | if (process.platform === 'win32') { | 12 | // Set app directory before loading user modules |
13 | app.setPath('appData', process.env.LOCALAPPDATA); | 13 | if (process.env.FERDI_APPDATA_DIR != null) { |
14 | app.setPath('userData', path.join(process.env.LOCALAPPDATA, app.getName())); | 14 | app.setPath('appData', process.env.FERDI_APPDATA_DIR); |
15 | } else if (process.env.PORTABLE_EXECUTABLE_DIR != null) { | ||
16 | app.setPath('appData', process.env.PORTABLE_EXECUTABLE_DIR, `${app.getName()}-appdata`); | ||
15 | } | 17 | } |
16 | 18 | ||
17 | if (isDevMode) { | 19 | if (isDevMode) { |