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 }