From 132048d5f919e906760c1ca302082258dd47d1fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20H=C3=A4usler?= Date: Sat, 28 Sep 2019 03:13:52 +0200 Subject: [PATCH] fix: #1382 portable application data directory --- src/main/cli/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/cli/index.js b/src/main/cli/index.js index 2531df51..6a2a88c3 100644 --- a/src/main/cli/index.js +++ b/src/main/cli/index.js @@ -1,4 +1,5 @@ import path from 'path' +import { app } from 'electron' import os from 'os' import { isDirectory } from 'common/filesystem' import parseArgs from './parser' @@ -51,7 +52,7 @@ const cli = () => { // Check for portable mode and ensure the user data path is absolute. We assume // that the path is writable if not this lead to an application crash. if (!args['--user-data-dir']) { - const portablePath = path.resolve('marktext-user-data') + const portablePath = path.join(app.getAppPath(), 'marktext-user-data') if (isDirectory(portablePath)) { args['--user-data-dir'] = portablePath }