Recently Written · git

cl-yag

Mirror and rewrite of Solène Rapenne's cl-yag SSG of renown

git clone https://github.com/equwal/cl-yag

Log | Files | Refs


commit f74fe5f96516ad07e66b118d01fee022baa43d56
Spenser Truex <truex@equwal.com>
2025-09-01 17:14:10 -0400

Bugfix: ensure files and directories jive

 generators-util.lisp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/generators-util.lisp b/generators-util.lisp
index c76559d..0de1b4a 100644
--- a/generators-util.lisp
+++ b/generators-util.lisp
@@ -30,7 +30,7 @@
 (defun load-file(path)
   "Load a file as a string. We escape ~ to avoid failures with format."
   (if (probe-file path)
-      (handler-case (with-open-file (stream path :if-exists :supersede :if-does-not-exist :create)
+      (handler-case (with-open-file (stream path :direction :input)
                       (let ((contents (make-string (file-length stream))))
                         (read-sequence contents stream)
                         contents))
@@ -40,6 +40,7 @@
 
 (defun save-file(path data)
   "Save a string to a file."
+  (ensure-directories-exist path)
   (with-open-file (stream path :direction :output :if-exists :supersede :if-does-not-exist :create)
 		  (write-sequence data stream)))