diff --git a/src/electron/electron/fs_watcher.cljs b/src/electron/electron/fs_watcher.cljs index d108f4de07..f959c97e9d 100644 --- a/src/electron/electron/fs_watcher.cljs +++ b/src/electron/electron/fs_watcher.cljs @@ -52,7 +52,7 @@ (utils/read-file path)) stat (when (and (not= event "unlink") (not dir-path?)) - (fs/statSync path))] + (utils/fs-stat->clj path))] (send-file-watcher! dir event (merge {:dir (utils/fix-win-path! dir) :path (utils/fix-win-path! path) :content content diff --git a/src/electron/electron/handler.cljs b/src/electron/electron/handler.cljs index 224d8e7b75..8ed172bbbd 100644 --- a/src/electron/electron/handler.cljs +++ b/src/electron/electron/handler.cljs @@ -123,7 +123,7 @@ (when (and (chmod-enabled?) (fs/existsSync path) (not (writable? path))) (fs/chmodSync path "644")) (fs/writeFileSync path content) - (fs/statSync path) + (utils/fs-stat->clj path) (catch :default e (logger/warn ::write-file path e) (let [backup-path (try @@ -144,7 +144,7 @@ (fs/renameSync old-path new-path)) (defmethod handle :stat [_window [_ path]] - (fs/statSync path)) + (utils/fs-stat->clj path)) (defn- get-files "Returns vec of file-objs" @@ -506,7 +506,6 @@ (debounced-configure-auto-commit!) nil) - (defmethod handle :installMarketPlugin [_ [_ mft]] (plugin/install-or-update! mft)) diff --git a/src/electron/electron/utils.cljs b/src/electron/electron/utils.cljs index 63c903399b..bcadf8d610 100644 --- a/src/electron/electron/utils.cljs +++ b/src/electron/electron/utils.cljs @@ -149,7 +149,6 @@ (logger/warn "Unknown PAC rule:" line) nil)))) - (defn clj + [path] + (let [stat (fs/statSync path)] + {:size (.-size stat) + :mtime (.-mtime stat) + :ctime (.-ctime stat)}))