diff --git a/core/cli/ci.el b/core/cli/ci.el index aabbbda5b..f1150945b 100644 --- a/core/cli/ci.el +++ b/core/cli/ci.el @@ -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))) - (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)))))) + (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))))))) ;; diff --git a/core/cli/install.el b/core/cli/install.el index 009f16902..ac7787949 100644 --- a/core/cli/install.el +++ b/core/cli/install.el @@ -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"))