Makefile, bin: Support multiple GOPATH components
License: MIT Signed-off-by: Péter Szilágyi <peterke@gmail.com>
Péter Szilágyi committed
Jun 5, 2016 at 19:53 UTC
dbc1d3f2d3306d88ce9d815d12d8c61ee29eaa6d
2 files changed
+11
-7
Makefile
+1
-1
@@ -41,7 +41,7 @@ bin/gx-go-v%:
41
gx_check: ${gx_bin} ${gx-go_bin}
42
43
path_check:
44
- @bin/check_go_path $(realpath $(shell pwd)) $(realpath $(GOPATH)/src/github.com/ipfs/go-ipfs)
44
+ @bin/check_go_path $(realpath $(shell pwd)) $(realpath $(addsuffix /src/github.com/ipfs/go-ipfs,$(subst :, ,$(GOPATH))))
45
46
deps: go_check gx_check path_check
47
${gx_bin} --verbose install --global
bin/check_go_path
+10
-6
@@ -1,7 +1,6 @@
1
#!/bin/sh
2
3
PWD=$1
4
-EXPECTED=$2
4
5
if [ -z "$PWD" ]; then
6
echo "must pass in your current working directory"
@@ -13,8 +12,13 @@ if [ -z "$GOPATH" ]; then
12
exit 1
13
fi
14
16
-if [ "$PWD" != "$EXPECTED" ]; then
17
- echo "go-ipfs must be built from within your \$GOPATH directory."
18
- echo "expected '$EXPECTED' but got '$PWD'"
19
- exit 1
20
-fi
15
+while [ ${#} -gt 1 ]; do
16
+ if [ "$PWD" = "$2" ]; then
17
+ exit 0
18
+ fi
19
+ shift
20
+done
21
+
22
+echo "go-ipfs must be built from within your \$GOPATH directory."
23
+echo "expected within '$GOPATH' but got '$PWD'"
24
+exit 1