mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-10 18:57:57 +08:00
avoid realpath in check_go_path
It doesn't exist on all operating systems. License: MIT Signed-off-by: Steven Allen <steven@stebalien.com>
This commit is contained in:
parent
439b0e35dc
commit
5ac752f1fb
@ -4,15 +4,20 @@ set -e
|
||||
|
||||
PKG="$1"
|
||||
|
||||
PWD="$(realpath "$(pwd)")"
|
||||
DIR="$(pwd -P)"
|
||||
GOPATH="$(go env GOPATH)"
|
||||
|
||||
for p in IFS=: "${GOPATH}"; do
|
||||
if [ "$PWD" = "$(realpath "$p")/src/$PKG" ]; then
|
||||
while read -d ':' p; do
|
||||
if ! cd "$p/src/$PKG" 2>/dev/null; then
|
||||
continue
|
||||
fi
|
||||
|
||||
if [ "$DIR" = "$(pwd -P)" ]; then
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
cd "$DIR"
|
||||
done <<< "$GOPATH:"
|
||||
|
||||
echo "go-ipfs must be built from within your \$GOPATH directory."
|
||||
echo "expected within '$GOPATH' but got '$PWD'"
|
||||
echo "expected within '$GOPATH' but got '$DIR'"
|
||||
exit 1
|
||||
|
||||
Loading…
Reference in New Issue
Block a user