Use deployed assets, not those in repo.
4 files changed, 16 insertions(+), 9 deletions(-)

M makefile
M src/main.lisp
M src/ui/ui-common.lisp
M src/utils.lisp
M makefile +4 -2
@@ 84,7 84,8 @@ build_manifest: check_root
 build: check_root
 	mkdir -p $(BUILDDIR)
 	$(FIND) $(CURDIR)/src/ -exec touch {} \;
-	$(BUILDAPP) $(B_FLAGS) 
+	$(BUILDAPP) $(B_FLAGS)
+	cp -a $(SRCDIR)/assets $(BUILDDIR)
 
 .PHONY: install
 install:

          
@@ 92,7 93,8 @@ install:
 	cp $(CURDIR)/infra/$(TARGET).service /lib/systemd/system/
 	systemctl daemon-reload
 # Feather binary
-	install -C -D -m 755 -o wimpie -g wimpie $(BUILDDIR)/$(TARGET) $(DESTDIR)/bin/$(BINNAME)
+	install -C -D -m 755 -o feather -g feather $(BUILDDIR)/$(TARGET) $(DESTDIR)/bin/$(BINNAME)
+# install assets. first delete then install
 	ln -sf $(DESTDIR)/bin/$(BINNAME) $(EXECDIR)/$(TARGET)
 
 .PHONY: migrate

          
M src/main.lisp +6 -2
@@ 17,13 17,17 @@ 
   ;; Set the global DB connection parameter variable
   (setf *db-spec* (list *db-name* *db-user* *db-pwd* *db-host* :pooled-p t))
 
+  ;; Configure Huncentoot. Set assets location.
+  (setq hunchentoot:*dispatch-table*
+        (list (hunchentoot:create-folder-dispatcher-and-handler
+               "/assets/" (assets-directory-pathname))))
+  
   ;; Configure Hunchentoot. Don't show errors to users.
   (setf hunchentoot:*show-lisp-errors-p* nil)
   (setf hunchentoot:*show-lisp-backtraces-p* nil)
 
   (unless (in-emacs-p)
-    (format t "~&~A~%" (executable-directory-pathname)))
-  )
+    (format t "~&~A~%" (executable-directory-pathname))))
 
 (defun finalise ()
   ;; Finalisation code

          
M src/ui/ui-common.lisp +0 -5
@@ 1,10 1,5 @@ 
 (in-package :feather)
 
-;;; Setup huncentoot
-(setq hunchentoot:*dispatch-table*
-      (list
-       (hunchentoot:create-folder-dispatcher-and-handler "/assets/" (asdf:system-relative-pathname "feather" "src/assets/"))))
-
 (defmacro check-parameter-non-zero-string (maybe-string)
   "Check if MAYBE-STRING is a string with non-zero length. Signal error if not."
   `(unless (and (stringp ,maybe-string) (not (str:emptyp ,maybe-string)))

          
M src/utils.lisp +6 -0
@@ 9,6 9,12 @@ 
   "Pathname of the secrets file."
   (asdf:system-relative-pathname :feather "../config/cfg-feather.lisp"))
 
+(defun assets-directory-pathname () 
+  "Pathname of the assets directory."
+  (if (in-emacs-p)
+      (asdf:system-relative-pathname "feather" "src/assets/")
+      (uiop:subpathname (executable-directory-pathname) "assets/")))
+  
 (eval-when (:compile-toplevel :load-toplevel :execute)
   (defun in-emacs-p ()
     "Currently in emacs."