|
|
@@ -16,7 +16,9 @@
|
|
|
[promesa.core :as p]
|
|
|
[frontend.state :as state]
|
|
|
[frontend.fs :as fs]
|
|
|
- [frontend.fs.capacitor-fs :as capacitor-fs]))
|
|
|
+ [frontend.fs.capacitor-fs :as capacitor-fs]
|
|
|
+ [frontend.util.fs :as fs-util]
|
|
|
+ [frontend.util :as util]))
|
|
|
|
|
|
;; all IPC paths must be normalized! (via gp-util/path-normalize)
|
|
|
|
|
|
@@ -120,16 +122,18 @@
|
|
|
(let [dir (config/get-repo-dir graph)]
|
|
|
(p/let [files (fs/readdir dir :path-only? true)]
|
|
|
(doseq [file files]
|
|
|
- (->
|
|
|
- (p/let [content (fs/read-file dir file)
|
|
|
- stat (fs/stat dir file)
|
|
|
- type (if (db/file-exists? graph file)
|
|
|
- "change"
|
|
|
- "add")]
|
|
|
- (handle-changed! type
|
|
|
- {:dir dir
|
|
|
- :path file
|
|
|
- :content content
|
|
|
- :stat stat}))
|
|
|
- (p/catch (fn [error]
|
|
|
- (js/console.dir error)))))))))
|
|
|
+ (when-let [ext (util/get-file-ext file)]
|
|
|
+ (->
|
|
|
+ (when-not (fs-util/ignored-path? dir file)
|
|
|
+ (p/let [content (fs/read-file dir file)
|
|
|
+ stat (fs/stat dir file)
|
|
|
+ type (if (db/file-exists? graph file)
|
|
|
+ "change"
|
|
|
+ "add")]
|
|
|
+ (handle-changed! type
|
|
|
+ {:dir dir
|
|
|
+ :path file
|
|
|
+ :content content
|
|
|
+ :stat stat})))
|
|
|
+ (p/catch (fn [error]
|
|
|
+ (js/console.dir error))))))))))
|