Skip to content

Commit

Permalink
Use GOMODCACHE, not GOPATH when building statik
Browse files Browse the repository at this point in the history
  • Loading branch information
honza committed Nov 28, 2020
1 parent 06feb07 commit 224d681
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
@@ -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/...
Expand Down

0 comments on commit 224d681

Please sign in to comment.