enhance: normalize all paths in app

This commit is contained in:
Junyi Du
2022-01-18 17:15:03 +08:00
committed by Tienson Qin
parent b72e0199d0
commit 37f08d96e1
5 changed files with 28 additions and 26 deletions

View File

@@ -47,7 +47,7 @@
(cond
mobile-native?
(map (fn [{:keys [uri content size mtime]}]
{:file/path (string/replace uri "file://" "")
{:file/path (util/path-normalize (string/replace uri "file://" ""))
:file/last-modified-at mtime
:file/size size
:file/content content})
@@ -56,7 +56,7 @@
electron?
(map (fn [{:keys [path stat content]}]
(let [{:keys [mtime size]} stat]
{:file/path path
{:file/path (util/path-normalize path)
:file/last-modified-at mtime
:file/size size
:file/content content}))
@@ -70,7 +70,7 @@
path (-> (get-attr "webkitRelativePath")
(string/replace-first (str dir-name "/") ""))]
{:file/name (get-attr "name")
:file/path path
:file/path (util/path-normalize path)
:file/last-modified-at (get-attr "lastModified")
:file/size (get-attr "size")
:file/type (get-attr "type")