Browse Source

enhance: pretty print pages-metadata.edn

This change allows for smaller git diffs of the versioned
pages-metadata.edn. Instead of one large line, the diff contains only
the actual changes.
Tomas Vik 4 năm trước cách đây
mục cha
commit
304bb54c43
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      src/main/frontend/handler/metadata.cljs

+ 2 - 1
src/main/frontend/handler/metadata.cljs

@@ -1,5 +1,6 @@
 (ns frontend.handler.metadata
   (:require [cljs.reader :as reader]
+            [cljs.pprint]
             [clojure.string :as string]
             [datascript.db :as ddb]
             [frontend.config :as config]
@@ -47,7 +48,7 @@
                        (vec))]
     (p/let [_ (-> (file-handler/create-pages-metadata-file repo)
                   (p/catch (fn [] nil)))]
-      (let [new-content (pr-str all-pages)]
+      (let [new-content (with-out-str (cljs.pprint/pprint all-pages))]
         (fs/write-file! repo
                         (config/get-repo-dir repo)
                         path