diff options
| author | eltrac <hi@eltr.ac> | 2026-08-28 22:59:38 +0800 |
|---|---|---|
| committer | eltrac <hi@eltr.ac> | 2026-08-28 22:59:46 +0800 |
| commit | 7058365d1419a0c5e0d53cb3e707fd17b7ac4918 (patch) | |
| tree | 4ff204d55e1c1ad58a9fc8431d67915f904402dc | |
| parent | 89f29291d0f14ad26d57b029dcb67c158b154d86 (diff) | |
main, cli: add build-template-and-print func; fix mapcar args; add build-one command
| -rw-r--r-- | tempest.lisp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/tempest.lisp b/tempest.lisp index 02bc03b..6d279c9 100644 --- a/tempest.lisp +++ b/tempest.lisp @@ -25,12 +25,18 @@ target-file)) NIL))) +(defun build-template-and-print (name) + (let ((built (build-template name))) + (if built + (format t "built ~a~%" built) + (format t "ignore ~a, not a valid tempest file.~%" name)))) + (defun build (dir) (cl-fad:walk-directory dir (lambda (path-name) (let ((name (namestring path-name))) (when (str:ends-with-p ".lisp" name :ignore-case T) - (build-template name)))))) + (build-template-and-print name)))))) ;; TODO handle frequent/simultaneous events, only build once ;; TODO handle :MOVE event, delete old one and create new one @@ -48,10 +54,12 @@ (defun run (subcommand &rest args) (cond ((equal subcommand "build") - (mapcar 'build args)) + (mapcar 'build (car args))) + ((equal subcommand "build-one") + (mapcar 'build-template-and-print (car args))) ;; TODO support watching multiple dirs ((equal subcommand "watch") - (watch (car args))))) + (watch (car (car args)))))) (defun main () (let ((cli-args (cdr sb-ext:*posix-argv*))) |
