Hugo hook: work in background
This commit is contained in:
parent
102c4d447f
commit
38358e8fae
@ -662,12 +662,13 @@ Return nil if DIR is not in a hugo project at all."
|
|||||||
(if hugo-dir
|
(if hugo-dir
|
||||||
(let* ((default-directory hugo-dir)
|
(let* ((default-directory hugo-dir)
|
||||||
(buffer (get-buffer-create "*hugo*")))
|
(buffer (get-buffer-create "*hugo*")))
|
||||||
(pop-to-buffer buffer)
|
(with-current-buffer buffer
|
||||||
(compilation-mode)
|
;; (pop-to-buffer buffer)
|
||||||
(if (zerop (let ((inhibit-read-only t))
|
(compilation-mode)
|
||||||
(call-process "sh" nil buffer t "-c" "hugo")))
|
(if (zerop (let ((inhibit-read-only t))
|
||||||
(message "Hugo re-generated!")
|
(call-process "sh" nil buffer t "-c" "hugo")))
|
||||||
(error "Hugo Failed, better change something!"))))))
|
(message "Hugo re-generated!")
|
||||||
|
(error "Hugo Failed, better change something!")))))))
|
||||||
(add-hook 'after-save-hook
|
(add-hook 'after-save-hook
|
||||||
(lambda () (hugo-compile default-directory))))
|
(lambda () (hugo-compile default-directory))))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user