From 1e6a59f6f525954a7939374d9a877490d421abb0 Mon Sep 17 00:00:00 2001 From: Alexander Artemenko Date: Sat, 6 Feb 2021 15:46:31 +0300 Subject: [PATCH] Templater was fixed. --- .github/actions/scripts/templater.ros | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/actions/scripts/templater.ros b/.github/actions/scripts/templater.ros index 731d706..a52fdac 100755 --- a/.github/actions/scripts/templater.ros +++ b/.github/actions/scripts/templater.ros @@ -26,10 +26,22 @@ exec ros -Q -L sbcl-bin -- $0 "$@" value)))) +(defun interpose (separator list) + "Returns a sequence of the elements of SEQUENCE separated by SEPARATOR." + (labels ((rec (s acc) + (if s + (rec (cdr s) (nconc acc + (list separator (car s)))) + acc))) + (cdr (rec list nil)))) + + (defun main (&rest argv) (declare (ignore argv)) (let* ((lines (uiop:slurp-stream-lines *standard-input*)) - (template-text (apply #'concatenate 'string lines)) + (template-text (apply #'concatenate 'string + (interpose (string #\Newline) + lines))) (template (djula::compile-string template-text)) (arguments (collect-arguments))) (apply #'djula:render-template*