Skip to content

Commit de7fe58

Browse files
authored
Merge pull request #238 from djpohly/gitdir-hook
Copy pre-commit hook to real GIT_DIR
2 parents ffa4136 + 0bd1524 commit de7fe58

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ SHELL=/bin/bash
44

55
STATIC_ANALYSIS_CHECKER := $(shell which shellcheck 2> /dev/null)
66
LINTER_CHECKER := $(shell which ec 2> /dev/null)
7+
GIT_DIR = $(shell git rev-parse --git-dir 2> /dev/null)
78

89
OS:=
910
ifeq ($(OS),Windows_NT)
@@ -72,7 +73,7 @@ env/example:
7273

7374
pre_commit/install:
7475
@echo "Installing pre-commit hooks"
75-
cp $(PRE_COMMIT_SCRIPTS_FILE) ./.git/hooks/
76+
cp $(PRE_COMMIT_SCRIPTS_FILE) $(GIT_DIR)/hooks/
7677

7778
pre_commit/run: test sa lint env/example
7879

0 commit comments

Comments
 (0)