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 #!/bin/sh
PWD=$1 set -e
if [ -z "$PWD" ]; then PKG="$1"
echo "must pass in your current working directory"
exit 1
fi
while [ ${#} -gt 1 ]; do PWD="$(realpath "$(pwd)")"
if [ "$PWD" = "$2" ]; then GOPATH="$(go env GOPATH)"
exit 0
fi for p in IFS=: "${GOPATH}"; do
shift if [ "$PWD" = "$(realpath "$p")/src/$PKG" ]; then
exit 0
fi
done done
echo "go-ipfs must be built from within your \$GOPATH directory." 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 exit 1
...@@ -66,7 +66,7 @@ check_go_version: ...@@ -66,7 +66,7 @@ check_go_version:
DEPS_GO += check_go_version DEPS_GO += check_go_version
check_go_path: 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 .PHONY: check_go_path
DEPS_GO += 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