Skip to content

Commit

Permalink
add makefile
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Okhlopkov <pavel.okhlopkov@flant.com>
  • Loading branch information
Pavel Okhlopkov committed Feb 5, 2025
1 parent edad314 commit f05f82b
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
GO=$(shell which go)
GIT=$(shell which git)

.PHONY: go-check
go-check:
$(call error-if-empty,$(GO),go)

.PHONY: git-check
git-check:
$(call error-if-empty,$(GIT),git)

.PHONY: go-module-version
go-module-version: go-check git-check
@echo "go get $(shell $(GO) list ./cmd/shell-operator)@$(shell $(GIT) rev-parse HEAD)"

.PHONY: test
test: go-check
@$(GO) test --race --cover ./...

define error-if-empty
@if [[ -z $(1) ]]; then echo "$(2) not installed"; false; fi
endef

0 comments on commit f05f82b

Please sign in to comment.