mirror of
https://github.com/marktext/marktext.git
synced 2025-05-17 01:10:41 +08:00
fix: #1382 portable application data directory
This commit is contained in:
parent
65d12af922
commit
132048d5f9
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user