Merge pull request #191 from egao1980/windows-blogging
Use robocopy on Windows
This commit is contained in:
commit
0b9f027a36
2 changed files with 25 additions and 1 deletions
21
plugins/robocopy.lisp
Normal file
21
plugins/robocopy.lisp
Normal file
|
@ -0,0 +1,21 @@
|
|||
|
||||
(defpackage :coleslaw-robocopy
|
||||
(:use :cl)
|
||||
(:import-from :coleslaw #:*config*
|
||||
#:deploy
|
||||
#:deploy-dir)
|
||||
(:export #:enable))
|
||||
|
||||
(in-package :coleslaw-robocopy)
|
||||
|
||||
(defvar *args* nil)
|
||||
|
||||
(defmethod deploy (staging)
|
||||
(coleslaw::run-program
|
||||
"(robocopy ~A ~A ~{~A~^ ~}) ^& IF %ERRORLEVEL% LEQ 1 exit 0"
|
||||
(merge-pathnames staging)
|
||||
(merge-pathnames (deploy-dir *config*))
|
||||
*args*))
|
||||
|
||||
(defun enable (&rest args)
|
||||
(setf *args* args))
|
|
@ -35,7 +35,10 @@
|
|||
(merge-pathnames "js" theme-dir)
|
||||
(repo-path "static")))
|
||||
(when (probe-file dir)
|
||||
(run-program "rsync --delete -raz ~a ." dir))))
|
||||
(if (uiop:os-windows-p)
|
||||
(run-program "(robocopy ~a ~a /MIR /IS) ^& IF %ERRORLEVEL% LEQ 1 exit 0" dir (path:basename dir))
|
||||
(run-program "rsync --delete -raz ~a ." dir))
|
||||
)))
|
||||
(do-subclasses (ctype content)
|
||||
(publish ctype))
|
||||
(do-subclasses (itype index)
|
||||
|
|
Loading…
Add table
Reference in a new issue