aboutsummaryrefslogtreecommitdiffstats
path: root/src/config.js
diff options
context:
space:
mode:
authorLibravatar Bennett <hello@vantezzen.io>2019-10-29 20:52:52 +0100
committerLibravatar GitHub <noreply@github.com>2019-10-29 20:52:52 +0100
commit12fdb01d9c4c06c601b7cf62b1b2f170a0ca65c2 (patch)
tree3d03e94559724ec47f8c7e76accbbfd1abb80813 /src/config.js
parentMerge pull request #161 from Makazzz/readme (diff)
parentRevert to 93e718a (diff)
downloadferdium-app-12fdb01d9c4c06c601b7cf62b1b2f170a0ca65c2.tar.gz
ferdium-app-12fdb01d9c4c06c601b7cf62b1b2f170a0ca65c2.tar.zst
ferdium-app-12fdb01d9c4c06c601b7cf62b1b2f170a0ca65c2.zip
Merge pull request #167 from Makazzz/portable-env
#87 Portable Directory working
Diffstat (limited to 'src/config.js')
-rw-r--r--src/config.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/config.js b/src/config.js
index 1db881d35..bd67aee6b 100644
--- a/src/config.js
+++ b/src/config.js
@@ -114,6 +114,18 @@ export const FILE_SYSTEM_SETTINGS_TYPES = [
114export const LOCAL_SERVER = 'You are using Ferdi without a server'; 114export const LOCAL_SERVER = 'You are using Ferdi without a server';
115export const SERVER_NOT_LOADED = 'Ferdi::SERVER_NOT_LOADED'; 115export const SERVER_NOT_LOADED = 'Ferdi::SERVER_NOT_LOADED';
116 116
117// Set app directory before loading user modules
118if (process.env.FERDI_APPDATA_DIR != null) {
119 app.setPath('appData', process.env.FERDI_APPDATA_DIR);
120 app.setPath('userData', path.join(app.getPath('appData')));
121} else if (process.env.PORTABLE_EXECUTABLE_DIR != null) {
122 app.setPath('appData', process.env.PORTABLE_EXECUTABLE_DIR, `${app.getName()}AppData`);
123 app.setPath('userData', path.join(app.getPath('appData'), `${app.getName()}AppData`));
124} else if (process.platform === 'win32') {
125 app.setPath('appData', process.env.APPDATA);
126 app.setPath('userData', path.join(app.getPath('appData'), app.getName()));
127}
128
117export const SETTINGS_PATH = path.join(app.getPath('userData'), 'config'); 129export const SETTINGS_PATH = path.join(app.getPath('userData'), 'config');
118 130
119// Replacing app.asar is not beautiful but unforunately necessary 131// Replacing app.asar is not beautiful but unforunately necessary