Browse Source

fix: ignore swap files

Tienson Qin 4 years ago
parent
commit
a283b92389
1 changed files with 5 additions and 2 deletions
  1. 5 2
      src/electron/electron/handler.cljs

+ 5 - 2
src/electron/electron/handler.cljs

@@ -89,8 +89,11 @@
   (let [watcher (.watch watcher dir
                         (clj->js
                          {:ignored (fn [path]
-                                     (some #(string/starts-with? path (str dir "/" %))
-                                           ["." "assets" "node_modules"]))
+                                     (or
+                                      (some #(string/starts-with? path (str dir "/" %))
+                                            ["." "assets" "node_modules"])
+                                      (some #(string/ends-with? path (str dir "/" %))
+                                            [".swap" ".crswap" ".tmp"])))
                           ;; :ignoreInitial true
                           :persistent true
                           :awaitWriteFinish true}))]