summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2023-03-14 11:43:05 +0100
committerLunny Xiao <xiaolunwen@gmail.com>2023-03-14 11:43:05 +0100
commit71f470d670af0d4f85370d2757b635b8c776d663 (patch)
treef740ef8f27cc23c64f086d5bb217a2296a47a522 /Makefile
parentUpdate readme to add pre-built binary download links (#45) (diff)
downloadforgejo-runner-71f470d670af0d4f85370d2757b635b8c776d663.tar.xz
forgejo-runner-71f470d670af0d4f85370d2757b635b8c776d663.zip
Fix make don't rebuild when go.mod changed (#49)
Fix #13 Reviewed-on: https://gitea.com/gitea/act_runner/pulls/49 Reviewed-by: delvh <dev.lh@web.de>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile7
1 files changed, 4 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 7d4b3e6..fbff6ab 100644
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,8 @@ RUNNER_CMD_PACKAGE_PATH := gitea.com/gitea/act_runner/cmd
LINUX_ARCHS ?= linux/amd64,linux/arm64
DARWIN_ARCHS ?= darwin-12/amd64,darwin-12/arm64
WINDOWS_ARCHS ?= windows/amd64
-GOFILES := $(shell find . -type f -name "*.go" ! -name "generated.*")
+GO_FMT_FILES := $(shell find . -type f -name "*.go" ! -name "generated.*")
+GOFILES := $(shell find . -type f -name "*.go" -o -name "go.mod" ! -name "generated.*")
ifneq ($(shell uname), Darwin)
EXTLDFLAGS = -extldflags "-static" $(null)
@@ -70,14 +71,14 @@ fmt:
@hash gofumpt > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
$(GO) install mvdan.cc/gofumpt@latest; \
fi
- $(GOFMT) -w $(GOFILES)
+ $(GOFMT) -w $(GO_FMT_FILES)
.PHONY: fmt-check
fmt-check:
@hash gofumpt > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
$(GO) install mvdan.cc/gofumpt@latest; \
fi
- @diff=$$($(GOFMT) -d $(GOFILES)); \
+ @diff=$$($(GOFMT) -d $(GO_FMT_FILES)); \
if [ -n "$$diff" ]; then \
echo "Please run 'make fmt' and commit the result:"; \
echo "$${diff}"; \