mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-24 14:08:13 +08:00
use makes realpath so its more crossplatform
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
This commit is contained in:
2
Makefile
2
Makefile
@ -29,7 +29,7 @@ gxgo_upgrade:
|
|||||||
go get -u github.com/whyrusleeping/gx-go
|
go get -u github.com/whyrusleeping/gx-go
|
||||||
|
|
||||||
path_check:
|
path_check:
|
||||||
@bin/check_go_path
|
@bin/check_go_path $(realpath $(shell pwd))
|
||||||
|
|
||||||
gx_check:
|
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" "0.3" 'Upgrade or install gx using your package manager or run `make gx_upgrade`'
|
||||||
|
@ -1,20 +1,21 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
PWD=$1
|
||||||
|
|
||||||
|
if [ -z "$PWD" ]; then
|
||||||
|
echo "must pass in your current working directory"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -z "$GOPATH" ]; then
|
if [ -z "$GOPATH" ]; then
|
||||||
echo "GOPATH not set, you must have go configured properly to install ipfs"
|
echo "GOPATH not set, you must have go configured properly to install ipfs"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
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"
|
EXPECTED="$GOPATH/src/github.com/ipfs/go-ipfs"
|
||||||
|
|
||||||
if [ "$REALPWD" != "$EXPECTED" ]; then
|
if [ "$PWD" != "$EXPECTED" ]; then
|
||||||
echo "go-ipfs must be built from within your \$GOPATH directory."
|
echo "go-ipfs must be built from within your \$GOPATH directory."
|
||||||
|
echo "expected '$EXPECTED' but got '$PWD'"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user