Take extra care in handling PREV in case the symlink has gone bad.

This commit is contained in:
Brit Butler 2012-08-29 00:54:54 -04:00
parent 7630285df5
commit 791e5cf325
2 changed files with 3 additions and 6 deletions

4
TODO
View file

@ -2,10 +2,6 @@ What about themes? Templates are themes. DUH.
Plugins? Injection support for HEAD and BODY. What about predicate-based injection?
BUGS:
; Generated directories aren't being removed properly.
; Post-receive hook on server doesn't appear to be executing. Invoking manually behaves as expected. What's going on here?
;; Suspect these issues are related. read-symlink doesn't return a directory pathname which causes cl-fad:delete-directory-and-files to blowup. Maybe stop using iolib for symlinks? What is portable?
;;; Propose replacing iolib based symlink code with something that uses DIRECTORY and/or TRUENAME.
; Slugs aren't unicode safe. See [reddit discussion](http://www.reddit.com/r/lisp/comments/yvh6g/coleslaw_jekylllike_static_blogware_in_500_lines/) and [mozilla code](https://github.com/mozilla/unicode-slugify/blob/master/slugify/__init__.py).
TODO:

View file

@ -52,7 +52,8 @@ If RAW is non-nil, write the content without wrapping it in the base template."
(ensure-directories-exist new-build)
(with-current-directory coleslaw-conf:*basedir*
(run-program "mv" (mapcar #'namestring (list staging new-build)))
(when (probe-file prev)
(if (and (probe-file prev) (equal prev (truename prev)))
(delete-file prev)
(cl-fad:delete-directory-and-files (truename prev)))
(when (probe-file curr)
(update-symlink prev (truename curr)))