From b126c761cd1ca3ae3b40cb421ddc86a34e5ce124 Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Mon, 25 May 2020 00:30:29 +0100 Subject: [PATCH] Desktop: Fixed portable app issue with resource paths --- ReactNativeClient/lib/BaseApplication.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ReactNativeClient/lib/BaseApplication.js b/ReactNativeClient/lib/BaseApplication.js index 31b93767b3..3a8dbe0f87 100644 --- a/ReactNativeClient/lib/BaseApplication.js +++ b/ReactNativeClient/lib/BaseApplication.js @@ -582,11 +582,17 @@ class BaseApplication { } determineProfileDir(initArgs) { - if (initArgs.profileDir) return initArgs.profileDir; + let output = ''; - if (process && process.env && process.env.PORTABLE_EXECUTABLE_DIR) return `${process.env.PORTABLE_EXECUTABLE_DIR}/JoplinProfile`; + if (initArgs.profileDir) { + output = initArgs.profileDir; + } else if (process && process.env && process.env.PORTABLE_EXECUTABLE_DIR) { + output = `${process.env.PORTABLE_EXECUTABLE_DIR}/JoplinProfile`; + } else { + output = `${os.homedir()}/.config/${Setting.value('appName')}`; + } - return toSystemSlashes(`${os.homedir()}/.config/${Setting.value('appName')}`, 'linux'); + return toSystemSlashes(output, 'linux'); } async start(argv) {