Skip to content

Commit 80ae723

Browse files
committed
build: fix the make build if the GOPATH env not set
Use `go env` to retrieve the `GOPATH` instead of a regular system environment.
1 parent 5502cc6 commit 80ae723

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ build:
2323
EXT=".exe"; \
2424
fi; \
2525
docker run -it --rm \
26-
-v $(GOPATH)/src/github.com/lopezator/sqlfmt:/go/src/github.com/lopezator/sqlfmt \
26+
-v $(shell go env GOPATH)/src/github.com/lopezator/sqlfmt:/go/src/github.com/lopezator/sqlfmt \
2727
-w /go/src/github.com/lopezator/sqlfmt \
2828
-e CGO_ENABLED=1 \
2929
$(BUILDER) \
@@ -41,4 +41,4 @@ sql-fmt:
4141
sql-check:
4242
@echo "Running sql-check..."
4343
@find . -name '*.sql' -print0 | xargs -I '{}' -0 \
44-
bash -c 'diff {} <(sqlfmt < {})' > /dev/null || (echo "sql-check failed, run \"make sql-fmt\" and try again"; exit 1)
44+
bash -c 'diff {} <(sqlfmt < {})' > /dev/null || (echo "sql-check failed, run \"make sql-fmt\" and try again"; exit 1)

0 commit comments

Comments
 (0)