From 3a5d2d1c68282861f7f99312a9ffa3cd320013f8 Mon Sep 17 00:00:00 2001 From: Brit Butler Date: Thu, 18 Apr 2013 15:53:42 -0400 Subject: [PATCH] Minor deploy cleanup. --- src/coleslaw.lisp | 26 +++++++++++--------------- src/packages.lisp | 1 + 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/src/coleslaw.lisp b/src/coleslaw.lisp index cfcbb12..271aacf 100644 --- a/src/coleslaw.lisp +++ b/src/coleslaw.lisp @@ -57,21 +57,17 @@ 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")) - (curr (rel-path dest ".curr"))) - (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)))) - (when (probe-file curr) - (update-symlink prev (truename curr))) - (update-symlink curr new-build))))) + (let* ((dest (deploy *config*)) + (new-build (rel-path dest "generated/~a" (get-universal-time))) + (prev (rel-path dest ".prev")) + (curr (rel-path dest ".curr"))) + (ensure-directories-exist new-build) + (run-program "mv ~a ~a" staging new-build) + (when (probe-file prev) + (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)))) (defun main (config-key) "Load the user's config section corresponding to CONFIG-KEY, then diff --git a/src/packages.lisp b/src/packages.lisp index e95e3a2..ad4dd7b 100644 --- a/src/packages.lisp +++ b/src/packages.lisp @@ -6,6 +6,7 @@ #:mappend #:compose) (:import-from :closure-template #:compile-template) + (:import-from :cl-fad #:delete-directory-and-files) (:export #:main #:preview #:*config*