浏览代码

Replace usage of RUN-PROGRAM with trivial-shell's SHELL-COMMAND.

Brit Butler 12 年之前
父节点
当前提交
e23fc10551
共有 3 个文件被更改,包括 6 次插入6 次删除
  1. 1 1
      coleslaw.asd
  2. 3 3
      src/coleslaw.lisp
  3. 2 2
      src/packages.lisp

+ 1 - 1
coleslaw.asd

@@ -6,7 +6,7 @@
6 6
   :author "Brit Butler <redline6561@gmail.com>"
7 7
   :pathname "src/"
8 8
   :depends-on (:alexandria :closure-template :3bmd :3bmd-ext-code-blocks
9
-               :local-time :iolib.os :cl-fad)
9
+               :local-time :trivial-shell :iolib.os :cl-fad)
10 10
   :serial t
11 11
   :components ((:file "packages")
12 12
                (:file "config")

+ 3 - 3
src/coleslaw.lisp

@@ -32,14 +32,14 @@ If RAW is non-nil, write the content without wrapping it in the base template."
32 32
           (static-dir (merge-pathnames "static" (repo *config*))))
33 33
       (dolist (dir (list css-dir static-dir))
34 34
         (when (probe-file dir)
35
-          (run-program "cp" `("-R" ,(namestring dir) ".")))))
35
+          (shell-command (format nil "cp -R ~a ." dir)))))
36 36
     (render-posts)
37 37
     (render-indices)
38 38
     (render-feed)))
39 39
 
40 40
 (defun update-symlink (path target)
41 41
   "Update the symlink at PATH to point to TARGET."
42
-  (run-program "ln" (list "-sfn" (namestring target) (namestring path))))
42
+  (shell-command (format nil "ln -sfn ~a ~a" target path)))
43 43
 
44 44
 (defgeneric deploy (staging)
45 45
   (:documentation "Deploy the STAGING dir, updating the .prev and .curr symlinks.")
@@ -51,7 +51,7 @@ If RAW is non-nil, write the content without wrapping it in the base template."
51 51
             (curr (deploy-path ".curr")))
52 52
         (ensure-directories-exist new-build)
53 53
         (with-current-directory coleslaw-conf:*basedir*
54
-          (run-program "mv" (mapcar #'namestring (list staging new-build)))
54
+          (shell-command (format nil "mv ~a ~a" staging new-build))
55 55
           (if (and (probe-file prev) (equal prev (truename prev)))
56 56
               (delete-file prev)
57 57
               (cl-fad:delete-directory-and-files (truename prev)))

+ 2 - 2
src/packages.lisp

@@ -1,8 +1,8 @@
1 1
 (defpackage :coleslaw
2 2
   (:documentation "Homepage: <a href=\"http://github.com/redline6561/coleslaw\">Github</a>")
3 3
   (:use :cl :closure-template)
4
-  (:import-from :iolib.os #:with-current-directory
5
-                          #:run-program)
4
+  (:import-from :trivial-shell #:shell-command)
5
+  (:import-from :iolib.os #:with-current-directory)
6 6
   (:import-from :alexandria #:hash-table-values
7 7
                             #:make-keyword)
8 8
   (:export #:main