|
@@ -5,10 +5,14 @@
|
5
|
5
|
If ARGS is provided, use (apply 'format nil PATH ARGS) as the value of PATH."
|
6
|
6
|
(merge-pathnames (apply 'format nil path args) coleslaw-conf:*basedir*))
|
7
|
7
|
|
8
|
|
-(defun to-pathname (file parent)
|
|
8
|
+(defun to-pathname (file &optional (parent coleslaw-conf:*basedir*))
|
9
|
9
|
"Convert an iolib file-path back to a pathname."
|
10
|
10
|
(merge-pathnames (file-path-namestring file) parent))
|
11
|
11
|
|
|
12
|
+(defun read-symlink (path)
|
|
13
|
+ "A trivial wrapper over iolib.os that returns the pathname in the symlink PATH."
|
|
14
|
+ (to-pathname (iolib.os:read-symlink path)))
|
|
15
|
+
|
12
|
16
|
(defmacro do-files ((var path &optional extension) &body body)
|
13
|
17
|
"For each file under PATH, run BODY. If EXTENSION is provided, only run BODY
|
14
|
18
|
on files that match the given extension."
|
|
@@ -67,7 +71,7 @@ on files that match the given extension."
|
67
|
71
|
(:documentation "Deploy DIR, updating the .prev and .curr symlinks.")
|
68
|
72
|
(:method (dir)
|
69
|
73
|
(let ((new-build (app-path "generated/~a" (get-universal-time))))
|
70
|
|
- (run-program "mv" (list dir (namestring new-build)))
|
|
74
|
+ (run-program "mv" (mapcar #'namestring (list dir new-build)))
|
71
|
75
|
(when (probe-file (app-path ".prev"))
|
72
|
76
|
(delete-directory-and-files (read-symlink (app-path ".prev"))))
|
73
|
77
|
(when (probe-file (app-path ".curr"))
|