Skip to content

Commit

Permalink
Add git hooks on check_env
Browse files Browse the repository at this point in the history
  • Loading branch information
deluan committed Apr 3, 2020
1 parent 9b46173 commit b8eb22d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ setup: Jamstash-master
@which goose || (echo "Installing Goose" && GO111MODULE=off go get -u github.com/pressly/goose/cmd/goose)
@which lefthook || (echo "Installing Lefthook" && GO111MODULE=off go get -u github.com/Arkweid/lefthook)
@lefthook install
@lefthook add pre-commit
@lefthook add pre-push
go mod download
@(cd ./ui && npm ci)
.PHONY: setup
Expand All @@ -57,6 +55,11 @@ Jamstash-master:
check_env: check_go_env check_node_env
.PHONE: check_env

check_hooks:
@lefthook add pre-commit
@lefthook add pre-push
.PHONE: check_hooks

check_go_env:
@(hash go) || (echo "\nERROR: GO environment not setup properly!\n"; exit 1)
@go version | grep -q $(GO_VERSION) || (echo "\nERROR: Please upgrade your GO version\nThis project requires version $(GO_VERSION)"; exit 1)
Expand Down

0 comments on commit b8eb22d

Please sign in to comment.