dev(ci): deploy git hooks on 'doom install'
This commit is contained in:
parent
3831096cfb
commit
3854c2fd70
2 changed files with 12 additions and 8 deletions
|
@ -13,19 +13,20 @@
|
|||
;;;
|
||||
|
||||
|
||||
(defun doom-cli--ci-deploy-hooks ()
|
||||
(defun doom-cli--ci-deploy-hooks (&optional noforce)
|
||||
(let ((dir (doom-path doom-emacs-dir ".git/hooks"))
|
||||
(default-directory doom-emacs-dir))
|
||||
(make-directory dir 'parents)
|
||||
(dolist (hook '("commit-msg" "pre-push"))
|
||||
(let ((file (doom-path dir hook)))
|
||||
(unless (and (file-exists-p file) noforce)
|
||||
(with-temp-file file
|
||||
(insert "#!/usr/bin/env sh\n"
|
||||
(doom-path doom-emacs-dir "bin/doom")
|
||||
" --nocolor ci hook-" hook
|
||||
" \"$@\""))
|
||||
(set-file-modes file #o700)
|
||||
(print! (success "Created %s") (relpath file))))))
|
||||
(print! (success "Created %s") (relpath file)))))))
|
||||
|
||||
|
||||
;;
|
||||
|
|
|
@ -73,6 +73,9 @@ name. e.g.
|
|||
(print! "Regenerating autoloads files")
|
||||
(doom-autoloads-reload)
|
||||
|
||||
(print! "Deploying commit-msg and pre-push git hooks")
|
||||
(doom-cli--ci-deploy-hooks)
|
||||
|
||||
(cond (nofonts-p)
|
||||
(IS-WINDOWS
|
||||
(print! (warn "Doom cannot install all-the-icons' fonts on Windows!\n"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue