Skip to content

Commit

Permalink
fix up git hook installer (ns1#87)
Browse files Browse the repository at this point in the history
* fix up git hook installer

it was linking to a path that doesn't exist

* add `make fmt` target

since the pre-commit hook's error message tells you to run that
  • Loading branch information
rupa authored Nov 26, 2019
1 parent 9a39ef6 commit 25b9eac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
all:

fmt:
go fmt ./...

test:
go fmt ./...
go vet ./...
golint ./...
go test ./...

.PHONY: all test
.PHONY: all fmt test
8 changes: 4 additions & 4 deletions script/install-git-hooks
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

(
cd """$(dirname "$0")""" || exit 1
cd .. || exit 1
for hook_source in git-hooks/*; do
cd ../.git/hooks || exit 1
for hook_source in ../../git-hooks/*; do
hook_name=$(basename "$hook_source")
echo "Linking $hook_name from $hook_source to .git/hooks/$hook_name"
ln -sf "git-hooks/$hook_name" ".git/hooks/$hook_name"
ln -sf "../../git-hooks/$hook_name" "$hook_name"
done
)
)

0 comments on commit 25b9eac

Please sign in to comment.