fix(windows): handle open dir

Fix #6438
pull/6336/head^2 0.8.2
Andelf 2022-08-22 04:04:23 +08:00
parent 1987c4149a
commit fe99ca703f
2 changed files with 2 additions and 2 deletions

View File

@ -72,7 +72,7 @@ contextBridge.exposeInMainWorld('apis', {
showItemInFolder (fullpath) {
if (IS_WIN32) {
shell.openPath(path.dirname(fullpath))
shell.openPath(path.dirname(fullpath).replaceAll("/", "\\"))
} else {
shell.showItemInFolder(fullpath)
}

View File

@ -487,7 +487,7 @@
(defn safe-path-join [prefix & paths]
(let [path (apply node-path.join (cons prefix paths))]
(if (and (electron?) (gstring/caseInsensitiveStartsWith path "file://"))
(subs path 7)
(js/decodeURIComponent (subs path 7))
path))))
(defn trim-safe