fix(electron): global config dir name under windows

pull/8739/head^2
Andelf 2023-03-02 11:17:49 +08:00
parent 1ff15171ed
commit 046e47d22e
1 changed files with 10 additions and 10 deletions

View File

@ -35,12 +35,19 @@
([url options]
(_fetch url (bean/->js (merge options {:agent @*fetchAgent})))))
(defn fix-win-path!
[path]
(when path
(if win32?
(string/replace path "\\" "/")
path)))
(defn get-ls-dotdir-root
[]
(let [lg-dir (path/join (.getPath app "home") ".logseq")]
(if-not (fs/existsSync lg-dir)
(do (fs/mkdirSync lg-dir) lg-dir)
lg-dir)))
(when-not (fs/existsSync lg-dir)
(fs/mkdirSync lg-dir))
(fix-win-path! lg-dir)))
(defn get-ls-default-plugins
[]
@ -214,13 +221,6 @@
(let [ext (string/lower-case (path/extname path))]
(contains? #{".md" ".markdown" ".org" ".js" ".edn" ".css"} ext)))
(defn fix-win-path!
[path]
(when path
(if win32?
(string/replace path "\\" "/")
path)))
(defn read-file
[path]
(try