mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-21 10:27:46 +08:00
Merge pull request #2399 from ipfs/fix/assert-gopath
assert that you must build from inside your gopath
This commit is contained in:
commit
6d4da612dd
5
Makefile
5
Makefile
@ -28,11 +28,14 @@ gx_upgrade:
|
||||
gxgo_upgrade:
|
||||
go get -u github.com/whyrusleeping/gx-go
|
||||
|
||||
path_check:
|
||||
@bin/check_go_path $(realpath $(shell pwd))
|
||||
|
||||
gx_check:
|
||||
@bin/check_gx_program "gx" "0.3" 'Upgrade or install gx using your package manager or run `make gx_upgrade`'
|
||||
@bin/check_gx_program "gx-go" "0.2" 'Upgrade or install gx-go using your package manager or run `make gxgo_upgrade`'
|
||||
|
||||
deps: go_check gx_check
|
||||
deps: go_check gx_check path_check
|
||||
gx --verbose install --global
|
||||
|
||||
# saves/vendors third-party dependencies to Godeps/_workspace
|
||||
|
||||
21
bin/check_go_path
Executable file
21
bin/check_go_path
Executable file
@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
|
||||
PWD=$1
|
||||
|
||||
if [ -z "$PWD" ]; then
|
||||
echo "must pass in your current working directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$GOPATH" ]; then
|
||||
echo "GOPATH not set, you must have go configured properly to install ipfs"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
EXPECTED="$GOPATH/src/github.com/ipfs/go-ipfs"
|
||||
|
||||
if [ "$PWD" != "$EXPECTED" ]; then
|
||||
echo "go-ipfs must be built from within your \$GOPATH directory."
|
||||
echo "expected '$EXPECTED' but got '$PWD'"
|
||||
exit 1
|
||||
fi
|
||||
Loading…
Reference in New Issue
Block a user