Merge pull request #191 from egao1980/windows-blogging

Use robocopy on Windows
This commit is contained in:
Cthulhux 2021-01-01 21:56:20 +01:00 committed by GitHub
commit 0b9f027a36
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 1 deletions

21
plugins/robocopy.lisp Normal file
View 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))

View file

@ -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)