From a5a5b69d3b96aa890909068e45c443460d52a697 Mon Sep 17 00:00:00 2001 From: Uko Kokņevičs Date: Sun, 19 Oct 2025 09:02:59 +0300 Subject: Work on launching scripts a bit --- src/main.lisp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'src/main.lisp') diff --git a/src/main.lisp b/src/main.lisp index fa7fab0..e68ca40 100644 --- a/src/main.lisp +++ b/src/main.lisp @@ -20,26 +20,24 @@ (enable-f-strings) -(defvar *in-prod* t) - -(defmacro reporty ((evt) &body body) - `(cond - (*in-prod* - (handler-case (progn ,@body) ; lint:suppress redundant-progn - (error (err) (report-error ,evt err)))) - (t ,@body))) +(defvar *in-prod* nil) (defun main () - (log:config :debug) (unwind-protect (progn - (conf:print-default #P"config.default.lisp") (conf:load-config #P"config.lisp") (log:info "Starting up ~A" (conf:bot-name)) (main-with-config) nil) (log:info "Quitting!"))) +(defmacro reporty ((evt) &body body) + `(cond + (*in-prod* + (handler-case (progn ,@body) ; lint:suppress redundant-progn + (error (err) (report-error ,evt err)))) + (t ,@body))) + (defun main-with-config () (unwind-protect (with-db (db (conf:db-path)) -- cgit v1.2.3