mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-21 10:27:46 +08:00
move gopath check to separate script and use realpath for symlink handling
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
This commit is contained in:
parent
cdea07dfc3
commit
65519a0367
2
Makefile
2
Makefile
@ -29,7 +29,7 @@ gxgo_upgrade:
|
||||
go get -u github.com/whyrusleeping/gx-go
|
||||
|
||||
path_check:
|
||||
test "$(shell pwd)" = "$(GOPATH)/src/github.com/ipfs/go-ipfs" || (echo "go-ipfs must be built from within your \$$GOPATH directory." && false)
|
||||
@bin/check_go_path
|
||||
|
||||
gx_check:
|
||||
@bin/check_gx_program "gx" "0.3" 'Upgrade or install gx using your package manager or run `make gx_upgrade`'
|
||||
|
||||
20
bin/check_go_path
Executable file
20
bin/check_go_path
Executable file
@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -z "$GOPATH" ]; then
|
||||
echo "GOPATH not set, you must have go configured properly to install ipfs"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! type -f realpath > /dev/null; then
|
||||
echo "program 'realpath' not found, it is required for this check"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PWD=$(pwd)
|
||||
REALPWD=$(realpath "$PWD")
|
||||
EXPECTED="$GOPATH/src/github.com/ipfs/go-ipfs"
|
||||
|
||||
if [ "$REALPWD" != "$EXPECTED" ]; then
|
||||
echo "go-ipfs must be built from within your \$GOPATH directory."
|
||||
exit 1
|
||||
fi
|
||||
Loading…
Reference in New Issue
Block a user