aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Okay <okay@toyful.space>2022-02-09 09:13:19 -0600
committerColin Okay <okay@toyful.space>2022-02-09 09:13:19 -0600
commit6225e142525d02888d0a1aa83fb716ddb58db907 (patch)
tree3727144770ff041d4dfef305cd7635ba0edf0670
parent9924bfa510d590b1218f6da083e736957abf7608 (diff)
more robust install-app
-rw-r--r--lazybones-hunchentoot.lisp8
1 files changed, 5 insertions, 3 deletions
diff --git a/lazybones-hunchentoot.lisp b/lazybones-hunchentoot.lisp
index e87fbd7..b010052 100644
--- a/lazybones-hunchentoot.lisp
+++ b/lazybones-hunchentoot.lisp
@@ -63,9 +63,11 @@ UNINSTALL-APP, START-SERVER, and STOP-SERVER."
(h:stop server))
(defun install-app (server app)
- "Installs a LAZYBONES:APP instance to SERVER."
- ;; TODO add assertsion here
- (push (if (symbolp app) (lzb:app app) app) (acceptor-apps server)))
+ "Installs a LAZYBONES:APP instance to SERVER, first checking that
+the app exists. If app is already isntalled, does nothing."
+ (a:if-let (app (and app (if (symbolp app) (lzb:app app) app)))
+ (pushnew app (acceptor-apps server) :key 'lzb::app-name)
+ (error () "No app to install.")))
(defun uninstall-app (server app)
(setf (acceptor-apps server)