Commit 439b0e35 authored by Steven Allen's avatar Steven Allen

fix check_go_path when it has spaces in it

fixes #5260

License: MIT
Signed-off-by: default avatarSteven Allen <steven@stebalien.com>
parent 6f140d25
#!/bin/sh
PWD=$1
set -e
if [ -z "$PWD" ]; then
echo "must pass in your current working directory"
exit 1
fi
PKG="$1"
while [ ${#} -gt 1 ]; do
if [ "$PWD" = "$2" ]; then
exit 0
fi
shift
PWD="$(realpath "$(pwd)")"
GOPATH="$(go env GOPATH)"
for p in IFS=: "${GOPATH}"; do
if [ "$PWD" = "$(realpath "$p")/src/$PKG" ]; then
exit 0
fi
done
echo "go-ipfs must be built from within your \$GOPATH directory."
echo "expected within '$(go env GOPATH)' but got '$PWD'"
echo "expected within '$GOPATH' but got '$PWD'"
exit 1
......@@ -66,7 +66,7 @@ check_go_version:
DEPS_GO += check_go_version
check_go_path:
bin/check_go_path $(realpath $(shell pwd)) $(realpath $(addsuffix /src/github.com/ipfs/go-ipfs,$(subst $(PATH_SEP),$(space),$(GOPATH))))
GOPATH="$(GOPATH)" bin/check_go_path github.com/ipfs/go-ipfs
.PHONY: check_go_path
DEPS_GO += check_go_path
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment