mob #2
This commit is contained in:
parent
7a6f31b96a
commit
86d001c2ce
1 changed files with 11 additions and 9 deletions
|
@ -1,6 +1,5 @@
|
|||
(ns dda.k8s-mastodon-bot.browser
|
||||
(:require
|
||||
[clojure.string :as st]
|
||||
[clojure.spec.alpha :as s]
|
||||
[clojure.tools.reader.edn :as edn]
|
||||
[expound.alpha :as expound]
|
||||
|
@ -41,14 +40,6 @@
|
|||
(.-value)
|
||||
(set! input)))
|
||||
|
||||
(defn validate-config! []
|
||||
(let [config (config-from-document)]
|
||||
(when-not (s/valid? ::core/config config)
|
||||
(-> config
|
||||
(edn/read-string)
|
||||
#(expound/expound-str ::core/config % {:print-specs? false})
|
||||
(render-validation-result-to-config)))))
|
||||
|
||||
(defn render-validation-result-to-config
|
||||
[validation-result]
|
||||
(print-debug validation-result)
|
||||
|
@ -60,6 +51,17 @@
|
|||
(.add "was-validated"))
|
||||
validation-result)
|
||||
|
||||
(defn expound-config [config]
|
||||
(expound/expound-str ::core/config config {:print-specs? false}))
|
||||
|
||||
(defn validate-config! []
|
||||
(let [config (config-from-document)]
|
||||
(when-not (s/valid? ::core/config config)
|
||||
(-> config
|
||||
(edn/read-string)
|
||||
(expound-config)
|
||||
(render-validation-result-to-config)))))
|
||||
|
||||
(defn init []
|
||||
(-> js/document
|
||||
(.getElementById "generate-button")
|
||||
|
|
Loading…
Reference in a new issue