Ensure output directory exists.

This commit is contained in:
Dominik Pantůček 2023-04-01 18:22:59 +02:00
parent 10ca5f9289
commit 0c9f2f36f0

View file

@ -38,6 +38,7 @@
(chicken string)
(chicken process-context)
(chicken pathname)
(chicken file)
member-record
utils
configuration)
@ -77,6 +78,10 @@
;; Generates all member files in given directory
(define (gen-web-static mb dir)
(when (file-exists? dir)
(error 'gen-web-static "Directory is a file:" dir))
(when (not (directory-exists? dir))
(create-directory dir))
(let loop ((mb mb))
(when (not (null? mb))
(gen-web-static-member (car mb) dir)