From b81e4af66a0f1d90c1741627ab172ebfb0408a1f Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 19 Jun 2022 23:03:50 +0200 Subject: [PATCH] fix(cli): deploy git hooks to repo at $PWD, not $EMACSDIR --- core/cli/ci.el | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/core/cli/ci.el b/core/cli/ci.el index 0a1dd6a30..f86a4a0b2 100644 --- a/core/cli/ci.el +++ b/core/cli/ci.el @@ -266,11 +266,14 @@ Note: warnings are not considered failures.") (defcli! (ci deploy-hooks) ((force ("--force"))) "TODO" - (let* ((default-directory doom-emacs-dir) - (repo-path (cdr (doom-call-process "git" "rev-parse" "--show-toplevel"))) - (submodule-p (string-empty-p (cdr (doom-call-process "git" "rev-parse" "show-superproject-working-tree")))) - (config-hooks-path (cdr (doom-call-process "git" "config" "core.hooksPath"))) - (hooks-path (cdr (doom-call-process "git" "rev-parse" "--git-path" "hooks")))) + (let* ((repo-path (sh! "git" "rev-parse" "--show-toplevel")) + (repo-path (if (zerop (car repo-path)) + (cdr repo-path) + (user-error "Cannot locate a git repo in %s" + (file-relative-name default-directory)))) + (submodule-p (string-empty-p (cdr (sh! "git" "rev-parse" "show-superproject-working-tree")))) + (config-hooks-path (cdr (sh! "git" "config" "core.hooksPath"))) + (hooks-path (cdr (sh! "git" "rev-parse" "--git-path" "hooks")))) (unless (string-empty-p config-hooks-path) (or force (y-or-n-p