Skip to content

Commit

Permalink
Add git hook pre-commit (#48)
Browse files Browse the repository at this point in the history
* chore/pre-commit

Add git hook pre-commit

* Create pre-commit

Signed-off-by: Rick <LinuxSuRen@users.noreply.github.com>

---------

Signed-off-by: Rick <LinuxSuRen@users.noreply.github.com>
  • Loading branch information
LinuxSuRen committed Jul 28, 2023
1 parent 61838cc commit 67d5fbe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/pre-commit
@@ -0,0 +1,2 @@
#!/bin/sh
make pre-commit
9 changes: 7 additions & 2 deletions Makefile
@@ -1,6 +1,7 @@
build: fmt
build:
CGO_ENABLE=0 go build -ldflags "-w -s" -o bin/github-go

test:
go test ./...
run:
go run main.go

Expand All @@ -9,3 +10,7 @@ fmt:

copy: build
sudo cp bin/github-go /usr/local/bin/github-go

pre-commit: fmt test build
install-pre-commit:
cp .github/pre-commit .git/hooks/pre-commit

0 comments on commit 67d5fbe

Please sign in to comment.