mirror of https://github.com/logseq/logseq
fix(electron): absolute path on win32
parent
bba717d533
commit
3e0e85aa03
|
@ -139,5 +139,7 @@ contextBridge.exposeInMainWorld('apis', {
|
||||||
|
|
||||||
setZoomFactor (factor) {
|
setZoomFactor (factor) {
|
||||||
webFrame.setZoomFactor(factor)
|
webFrame.setZoomFactor(factor)
|
||||||
}
|
},
|
||||||
|
|
||||||
|
isAbsolutePath: path.isAbsolute.bind(path)
|
||||||
})
|
})
|
||||||
|
|
|
@ -138,9 +138,10 @@
|
||||||
([repo dir path]
|
([repo dir path]
|
||||||
(create-if-not-exists repo dir path ""))
|
(create-if-not-exists repo dir path ""))
|
||||||
([repo dir path initial-content]
|
([repo dir path initial-content]
|
||||||
(let [path (if (util/starts-with? path "/")
|
(let [path (if (util/is-absolute-path path) path
|
||||||
path
|
(if (util/starts-with? path "/")
|
||||||
(str "/" path))]
|
path
|
||||||
|
(str "/" path)))]
|
||||||
(->
|
(->
|
||||||
(p/let [stat (stat dir path)]
|
(p/let [stat (stat dir path)]
|
||||||
true)
|
true)
|
||||||
|
|
|
@ -1070,6 +1070,14 @@
|
||||||
(defonce win32? #?(:cljs goog.userAgent/WINDOWS
|
(defonce win32? #?(:cljs goog.userAgent/WINDOWS
|
||||||
:clj nil))
|
:clj nil))
|
||||||
|
|
||||||
|
#?(:cljs
|
||||||
|
(defn is-absolute-path
|
||||||
|
[path]
|
||||||
|
(try
|
||||||
|
(js/window.apis.isAbsolutePath path)
|
||||||
|
(catch js/Error _
|
||||||
|
(node-path.isAbsolute path)))))
|
||||||
|
|
||||||
(defn ->system-modifier
|
(defn ->system-modifier
|
||||||
[keyboard-shortcut]
|
[keyboard-shortcut]
|
||||||
(if mac?
|
(if mac?
|
||||||
|
|
Loading…
Reference in New Issue