From 4b69f1d1047efc64705e08ffbb363643147d7206 Mon Sep 17 00:00:00 2001 From: Makazzz Date: Tue, 29 Oct 2019 15:06:56 -0400 Subject: Revert to 93e718a --- src/config.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/config.js') diff --git a/src/config.js b/src/config.js index 33067fc9d..a7389b8bc 100644 --- a/src/config.js +++ b/src/config.js @@ -113,9 +113,17 @@ export const FILE_SYSTEM_SETTINGS_TYPES = [ export const LOCAL_SERVER = 'You are using Ferdi without a server'; -import { portable } from './helpers/portable-helpers'; - -portable(); +// Set app directory before loading user modules +if (process.env.FERDI_APPDATA_DIR != null) { + app.setPath('appData', process.env.FERDI_APPDATA_DIR); + app.setPath('userData', path.join(app.getPath('appData'))); +} else if (process.env.PORTABLE_EXECUTABLE_DIR != null) { + app.setPath('appData', process.env.PORTABLE_EXECUTABLE_DIR, `${app.getName()}AppData`); + app.setPath('userData', path.join(app.getPath('appData'), `${app.getName()}AppData`)); +} else if (process.platform === 'win32') { + app.setPath('appData', process.env.APPDATA); + app.setPath('userData', path.join(app.getPath('appData'), app.getName())); +} export const SETTINGS_PATH = path.join(app.getPath('userData'), 'config'); -- cgit v1.2.3-54-g00ecf