diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-03-03 02:33:15 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-03-07 22:06:03 +0100 |
commit | 455fa40ef2dff848397ac319d69af7514cbeae07 (patch) | |
tree | 89b3e947c3f6db7c94c292c07d8cd83b8132493c /module | |
parent | Rewrote checksum->string. (diff) | |
download | calp-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.scm | 8 |
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) |