diff --git a/plugins/robocopy.lisp b/plugins/robocopy.lisp new file mode 100644 index 0000000..7e84521 --- /dev/null +++ b/plugins/robocopy.lisp @@ -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)) diff --git a/src/coleslaw.lisp b/src/coleslaw.lisp index 1517c66..1d380ac 100644 --- a/src/coleslaw.lisp +++ b/src/coleslaw.lisp @@ -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)