From 05100ffe58260942ed2802a7512e94f6bc6b4cbc Mon Sep 17 00:00:00 2001 From: heyarne Date: Mon, 12 Jul 2021 23:50:26 +0200 Subject: [PATCH] Expose a netrepl when running bagatto in repl mode --- index.janet | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/index.janet b/index.janet index c1d6a34..b827fbc 100644 --- a/index.janet +++ b/index.janet @@ -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"}}