smithy.git

commit 224d6814d266b9fea1d76160e01cc2a7faab17c5

Author: Honza Pokorny <me@honza.ca>

Use GOMODCACHE, not GOPATH when building statik

 Makefile | 7 +++++--


diff --git a/Makefile b/Makefile
index 6394536580e9ab47d05f04e14be9980867780738..e5f42c4b9b7dad9cc7e7207bdfe7d015dea6f89e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,15 +1,18 @@
 BUILD_VERSION ?= $(shell git describe --always --abbrev=40 --dirty)
 
 LDFLAGS="-X github.com/honza/smithy/cmd.SmithyVersion=${BUILD_VERSION}"
+MODCACHE := $(shell go env GOMODCACHE)
+
+export CGO_ENABLED=0
 
 all: bin/statik
 	bin/statik -src=include -dest=pkg -f -m
-	CGO_ENABLED=0 go build -ldflags $(LDFLAGS) -o smithy main.go
+	go build -ldflags $(LDFLAGS) -o smithy main.go
 
 bin/statik:
 	mkdir -p bin
 	go mod download
-	go build -o bin/statik $(GOPATH)/src/github.com/rakyll/statik/statik.go
+	go build -o bin/statik $(MODCACHE)/github.com/rakyll/statik@v0.1.7/statik.go
 
 gofmt:
 	go fmt ./pkg/... ./cmd/...