Expose a netrepl when running bagatto in repl mode

This commit is contained in:
heyarne 2021-07-12 23:50:26 +02:00
commit 05100ffe58

View file

@ -1,8 +1,23 @@
(import janet-html :as html)
(import path)
(import spork/netrepl)
(import ./views)
# ---
# expose the a netrepl for conjure to connect to when running in repl mode
# ---
(defn bag-repl? [cli-args]
(= ["bag" "--repl"] (slice cli-args 0 2)))
(def conjure-repl
(when (bag-repl? (dyn :args))
(thread/new (fn [_] (netrepl/server)))))
# ---
# site config
# ---
(bagatto/set-output-dir! "site")
(def data {:config {:attrs {:title "arnes.space"}}