Rework reset/draft publish logic
This commit is contained in:
parent
c3df4d429e
commit
7690dc82f2
14
publish.el
14
publish.el
|
@ -491,13 +491,13 @@ PROJECT is the current project."
|
|||
(if (= html-changed-files 0)
|
||||
(warn! "No changes to push")
|
||||
(let ((default-directory html-dir))
|
||||
(and (or source-draft-p
|
||||
(prog1 (or (not html-draft-p)
|
||||
(git-try-command "reset" "--soft" "HEAD~1"))
|
||||
(dolist (file (mapcar #'cdr (get-unstaged-changes)))
|
||||
(when (and (file-exists-p file)
|
||||
(string-prefix-p "DRAFT-" (file-name-base file)))
|
||||
(delete-file file)))))
|
||||
(and (prog1 (or (not html-draft-p)
|
||||
(git-try-command "reset" "--soft" "HEAD~1"))
|
||||
(unless source-draft-p
|
||||
(dolist (file (mapcar #'cdr (get-unstaged-changes)))
|
||||
(when (and (file-exists-p file)
|
||||
(string-prefix-p "DRAFT-" (file-name-base file)))
|
||||
(delete-file file)))))
|
||||
(git-try-command "add" "-A")
|
||||
(git-try-command "commit" "--message" commit-message)
|
||||
(git-try-command "push" (and html-draft-p "--force-with-lease"))))))
|
||||
|
|
Loading…
Reference in a new issue