mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-28 00:39:31 +08:00
Merge pull request #4678 from ipfs/fix/gopath-default
build: match Go's GOPATH defaults behaviour
This commit is contained in:
@ -7,11 +7,6 @@ if [ -z "$PWD" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$GOPATH" ]; then
|
|
||||||
echo "GOPATH not set, you must have go configured properly to install ipfs"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
while [ ${#} -gt 1 ]; do
|
while [ ${#} -gt 1 ]; do
|
||||||
if [ "$PWD" = "$2" ]; then
|
if [ "$PWD" = "$2" ]; then
|
||||||
exit 0
|
exit 0
|
||||||
@ -20,5 +15,5 @@ while [ ${#} -gt 1 ]; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
echo "go-ipfs must be built from within your \$GOPATH directory."
|
echo "go-ipfs must be built from within your \$GOPATH directory."
|
||||||
echo "expected within '$GOPATH' but got '$PWD'"
|
echo "expected within '$(go env GOPATH)' but got '$PWD'"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -1,12 +1,16 @@
|
|||||||
# golang utilities
|
# golang utilities
|
||||||
GO_MIN_VERSION = 1.9
|
GO_MIN_VERSION = 1.9
|
||||||
|
|
||||||
|
|
||||||
# pre-definitions
|
# pre-definitions
|
||||||
GOCC ?= go
|
GOCC ?= go
|
||||||
GOTAGS ?=
|
GOTAGS ?=
|
||||||
GOFLAGS ?=
|
GOFLAGS ?=
|
||||||
GOTFLAGS ?=
|
GOTFLAGS ?=
|
||||||
|
|
||||||
|
# match Go's default GOPATH behaviour
|
||||||
|
export GOPATH ?= $(shell $(GOCC) env GOPATH)
|
||||||
|
|
||||||
DEPS_GO :=
|
DEPS_GO :=
|
||||||
TEST_GO :=
|
TEST_GO :=
|
||||||
TEST_GO_BUILD :=
|
TEST_GO_BUILD :=
|
||||||
|
Reference in New Issue
Block a user