aboutsummaryrefslogtreecommitdiff
path: root/module
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-03-03 02:33:15 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2022-03-07 22:06:03 +0100
commit455fa40ef2dff848397ac319d69af7514cbeae07 (patch)
tree89b3e947c3f6db7c94c292c07d8cd83b8132493c /module
parentRewrote checksum->string. (diff)
downloadcalp-455fa40ef2dff848397ac319d69af7514cbeae07.tar.gz
calp-455fa40ef2dff848397ac319d69af7514cbeae07.tar.xz
Handle broken symlink when generating static HTML.
Diffstat (limited to 'module')
-rw-r--r--module/calp/entry-points/html.scm8
1 files changed, 7 insertions, 1 deletions
diff --git a/module/calp/entry-points/html.scm b/module/calp/entry-points/html.scm
index 7c4fe257..61489a85 100644
--- a/module/calp/entry-points/html.scm
+++ b/module/calp/entry-points/html.scm
@@ -75,7 +75,13 @@
;; TODO nicer way to resolve static
(let ((link (path-append output-directory "static")))
(unless (file-exists? link)
- (symlink (path-append (xdg-data-home) "calp" "www" "static") link)))))
+ (if (catch 'system-error
+ (lambda () (lstat link))
+ (lambda (err proc fmt fmt-args data)
+ #f))
+ (format #t "WARNING: broken symlink ~s → ~s~%"
+ link (readlink link))
+ (symlink (path-append (xdg-data-home) "calp" "www" "static") link))))))
(define (re-root-static tree)