summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2022-03-15 13:21:18 +0530
committerArun Isaac2022-03-15 13:22:43 +0530
commitf8e32fd17a1fc3730dd3b6601133e65cd7f9df9d (patch)
treee8f597a3b979a40e223ecdd8e0a00c870b23117c
parent20a9314c014883665fa3e2b304b7184231491c46 (diff)
downloadtissue-f8e32fd17a1fc3730dd3b6601133e65cd7f9df9d.tar.gz
tissue-f8e32fd17a1fc3730dd3b6601133e65cd7f9df9d.tar.lz
tissue-f8e32fd17a1fc3730dd3b6601133e65cd7f9df9d.zip
tissue: Raise exception on missing file when building website.
* tissue/web.scm (build-website): Raise exception on missing file.
-rw-r--r--tissue/web.scm22
1 files changed, 14 insertions, 8 deletions
diff --git a/tissue/web.scm b/tissue/web.scm
index 715e5c7..2f8036c 100644
--- a/tissue/web.scm
+++ b/tissue/web.scm
@@ -205,14 +205,20 @@ per-tag issue listings are not generated."
(string-suffix? ".skb" input-file))
(with-output-to-file output-file
(cut evaluate-document
- (call-with-input-file input-file
- (cut evaluate-ast-from-port <>
- #:reader ((reader:make (lookup-reader
- (cond
- ((string-suffix? ".gmi" input-file)
- 'gemtext)
- ((string-suffix? ".skb" input-file)
- 'skribe)))))))
+ ;; Files may be renamed or deleted, but
+ ;; not committed. Therefore, raise an
+ ;; exception if the file does not exist.
+ (if (file-exists? input-file)
+ (call-with-input-file input-file
+ (cut evaluate-ast-from-port <>
+ #:reader ((reader:make (lookup-reader
+ (cond
+ ((string-suffix? ".gmi" input-file)
+ 'gemtext)
+ ((string-suffix? ".skb" input-file)
+ 'skribe)))))))
+ (raise (make-message-condition
+ (string-append "No such file or directory: " input-file))))
(find-engine 'html)))
(copy-file input-file output-file))))))
rcons get-line port))