|
@@ -39,20 +39,19 @@ If RAW is non-nil, write the content without wrapping it in the base template."
|
39
|
39
|
(defgeneric deploy (staging)
|
40
|
40
|
(:documentation "Deploy the STAGING dir, updating the .prev and .curr symlinks.")
|
41
|
41
|
(:method (staging)
|
42
|
|
- (flet ((deploy-path (path &rest args)
|
43
|
|
- (merge-pathnames (apply 'format nil path args) (deploy *config*))))
|
44
|
|
- (let ((new-build (deploy-path "generated/~a" (get-universal-time)))
|
45
|
|
- (prev (deploy-path ".prev"))
|
46
|
|
- (curr (deploy-path ".curr")))
|
|
42
|
+ (with-current-directory coleslaw-conf:*basedir*
|
|
43
|
+ (let* ((coleslaw-conf:*basedir* (deploy *config*))
|
|
44
|
+ (new-build (app-path "generated/~a" (get-universal-time)))
|
|
45
|
+ (prev (app-path ".prev"))
|
|
46
|
+ (curr (app-path ".curr")))
|
47
|
47
|
(ensure-directories-exist new-build)
|
48
|
|
- (with-current-directory coleslaw-conf:*basedir*
|
49
|
|
- (run-program "mv ~a ~a" staging new-build)
|
50
|
|
- (if (and (probe-file prev) (equal prev (truename prev)))
|
51
|
|
- (delete-file prev)
|
52
|
|
- (cl-fad:delete-directory-and-files (truename prev)))
|
53
|
|
- (when (probe-file curr)
|
54
|
|
- (update-symlink prev (truename curr)))
|
55
|
|
- (update-symlink curr new-build))))))
|
|
48
|
+ (run-program "mv ~a ~a" staging new-build)
|
|
49
|
+ (if (and (probe-file prev) (equal prev (truename prev)))
|
|
50
|
+ (delete-file prev)
|
|
51
|
+ (cl-fad:delete-directory-and-files (truename prev)))
|
|
52
|
+ (when (probe-file curr)
|
|
53
|
+ (update-symlink prev (truename curr)))
|
|
54
|
+ (update-symlink curr new-build)))))
|
56
|
55
|
|
57
|
56
|
(defun main ()
|
58
|
57
|
"Load the user's config, then compile and deploy the blog."
|