mirror of
https://github.com/logseq/logseq.git
synced 2026-06-01 19:01:22 +00:00
fix(electron): absolute path on win32
This commit is contained in:
@@ -138,9 +138,10 @@
|
||||
([repo dir path]
|
||||
(create-if-not-exists repo dir path ""))
|
||||
([repo dir path initial-content]
|
||||
(let [path (if (util/starts-with? path "/")
|
||||
path
|
||||
(str "/" path))]
|
||||
(let [path (if (util/is-absolute-path path) path
|
||||
(if (util/starts-with? path "/")
|
||||
path
|
||||
(str "/" path)))]
|
||||
(->
|
||||
(p/let [stat (stat dir path)]
|
||||
true)
|
||||
|
||||
@@ -1070,6 +1070,14 @@
|
||||
(defonce win32? #?(:cljs goog.userAgent/WINDOWS
|
||||
:clj nil))
|
||||
|
||||
#?(:cljs
|
||||
(defn is-absolute-path
|
||||
[path]
|
||||
(try
|
||||
(js/window.apis.isAbsolutePath path)
|
||||
(catch js/Error _
|
||||
(node-path.isAbsolute path)))))
|
||||
|
||||
(defn ->system-modifier
|
||||
[keyboard-shortcut]
|
||||
(if mac?
|
||||
|
||||
Reference in New Issue
Block a user