Minor deploy cleanup.

This commit is contained in:
Brit Butler 2013-04-18 15:53:42 -04:00
parent f6e78dd47c
commit 3a5d2d1c68
2 changed files with 12 additions and 15 deletions

View file

@ -57,7 +57,6 @@ Additional args to render CONTENT can be passed via RENDER-ARGS."
(defgeneric deploy (staging)
(:documentation "Deploy the STAGING dir, updating the .prev and .curr symlinks.")
(:method (staging)
(with-current-directory coleslaw-conf:*basedir*
(let* ((dest (deploy *config*))
(new-build (rel-path dest "generated/~a" (get-universal-time)))
(prev (rel-path dest ".prev"))
@ -65,13 +64,10 @@ Additional args to render CONTENT can be passed via RENDER-ARGS."
(ensure-directories-exist new-build)
(run-program "mv ~a ~a" staging new-build)
(when (probe-file prev)
(let ((dest (truename prev)))
(if (equal prev dest)
(delete-file prev)
(run-program "rm -R ~a" dest))))
(delete-directory-and-files (truename prev) :if-does-not-exist :ignore))
(when (probe-file curr)
(update-symlink prev (truename curr)))
(update-symlink curr new-build)))))
(update-symlink curr new-build))))
(defun main (config-key)
"Load the user's config section corresponding to CONFIG-KEY, then

View file

@ -6,6 +6,7 @@
#:mappend
#:compose)
(:import-from :closure-template #:compile-template)
(:import-from :cl-fad #:delete-directory-and-files)
(:export #:main
#:preview
#:*config*