mirror of
https://github.com/logseq/logseq.git
synced 2026-04-24 22:25:01 +00:00
First pass at schema for global config
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
(:require [malli.core :as m]
|
||||
[malli.error :as me]
|
||||
[frontend.schema.handler.plugin-config :as plugin-config-schema]
|
||||
[frontend.schema.handler.global-config :as global-config-schema]
|
||||
[clojure.pprint :as pprint]
|
||||
[clojure.edn :as edn]))
|
||||
|
||||
@@ -18,3 +19,16 @@
|
||||
(println "Found errors:")
|
||||
(pprint/pprint errors))
|
||||
(println "Valid!")))
|
||||
|
||||
(defn validate-global-config-edn
|
||||
"Validate a global config.edn file"
|
||||
[file]
|
||||
(if-let [errors (->> file
|
||||
slurp
|
||||
edn/read-string
|
||||
(m/explain global-config-schema/Config-edn)
|
||||
me/humanize)]
|
||||
(do
|
||||
(println "Found errors:")
|
||||
(pprint/pprint errors))
|
||||
(println "Valid!")))
|
||||
|
||||
Reference in New Issue
Block a user