Changeset View
Changeset View
Standalone View
Standalone View
bin/build-config-tmpl
#!/usr/bin/env -S /usr/bin/sbcl --script | #!/usr/bin/env -S /usr/bin/sbcl --script | ||||
(let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp" | (let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp" | ||||
(user-homedir-pathname)))) | (user-homedir-pathname)))) | ||||
(when (probe-file quicklisp-init) | (when (probe-file quicklisp-init) | ||||
(load quicklisp-init))) | (load quicklisp-init))) | ||||
(ql:quickload :forgerie) | (ql:quickload :forgerie) | ||||
(with-open-file (str "config/config.lisp.tmpl" :direction :output :if-exists :supersede) | (with-open-file (str "config/config.lisp.tmpl" :direction :output :if-exists :supersede) | ||||
(format str | (format str | ||||
";;;; This template file is generated by bin/build-config-templ and should not be edited manuall. | ";;;; This template file is generated by bin/build-config-templ and should not be edited manually. | ||||
;;;; | ;;;; | ||||
;;;; Install by copying to config.lisp~%~%") | ;;;; Install by copying to config.lisp~%~%") | ||||
(mapcar | (mapcar | ||||
(lambda (section) | (lambda (section) | ||||
(format str ";;;;;;;;;;;;;;;;;;;~%;;; ~A~%;;;;;;;;;;;;;;;;;;;~%~%" (car section)) | (format str ";;;;;;;;;;;;;;;;;;;~%;;; ~A~%;;;;;;;;;;;;;;;;;;;~%~%" (car section)) | ||||
(mapcar | (mapcar | ||||
(lambda (variable-def) | (lambda (variable-def) | ||||
(let | (let | ||||
((variable-name (if (listp variable-def) (car variable-def) variable-def)) | ((variable-name (if (listp variable-def) (car variable-def) variable-def)) | ||||
(default (if (listp variable-def) (cadr variable-def) "nil"))) | (default (if (listp variable-def) (cadr variable-def) "nil"))) | ||||
(format str | (format str | ||||
"~{;~A~%~}(setf ~(~A~):~(~A~) ~A)~%~%" | "~{;~A~%~}(setf ~(~A~):~(~A~) ~A)~%~%" | ||||
(mapcar | (mapcar | ||||
(lambda (line) | (lambda (line) | ||||
(if (< 0 (length line)) | (if (< 0 (length line)) | ||||
(cl-ppcre:regex-replace-all "^ ?" line " ") | (cl-ppcre:regex-replace-all "^ ?" line " ") | ||||
"")) | "")) | ||||
(cl-ppcre:split "\\n" (documentation variable-name 'variable))) | (cl-ppcre:split "\\n" (documentation variable-name 'variable))) | ||||
(package-name (symbol-package variable-name)) | (package-name (symbol-package variable-name)) | ||||
Show All 35 Lines |