use makes realpath so its more crossplatform
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
Jeromy committed
Mar 1, 2016 at 11:24 UTC
aa6db5dde3c856d6f71027a5438fd3055da56c84
2 files changed
+9
-8
Makefile
+1
-1
@@ -29,7 +29,7 @@ gxgo_upgrade:
29
go get -u github.com/whyrusleeping/gx-go
30
31
path_check:
32
- @bin/check_go_path
32
+ @bin/check_go_path $(realpath $(shell pwd))
33
34
gx_check:
35
@bin/check_gx_program "gx" "0.3" 'Upgrade or install gx using your package manager or run `make gx_upgrade`'
bin/check_go_path
+8
-7
@@ -1,20 +1,21 @@
1
#!/bin/sh
2
3
-if [ -z "$GOPATH" ]; then
4
- echo "GOPATH not set, you must have go configured properly to install ipfs"
3
+PWD=$1
4
+
5
+if [ -z "$PWD" ]; then
6
+ echo "must pass in your current working directory"
7
exit 1
8
fi
9
8
-if ! type -f realpath > /dev/null; then
9
- echo "program 'realpath' not found, it is required for this check"
10
+if [ -z "$GOPATH" ]; then
11
+ echo "GOPATH not set, you must have go configured properly to install ipfs"
12
exit 1
13
fi
14
13
-PWD=$(pwd)
14
-REALPWD=$(realpath "$PWD")
15
EXPECTED="$GOPATH/src/github.com/ipfs/go-ipfs"
16
17
-if [ "$REALPWD" != "$EXPECTED" ]; then
17
+if [ "$PWD" != "$EXPECTED" ]; then
18
echo "go-ipfs must be built from within your \$GOPATH directory."
19
+ echo "expected '$EXPECTED' but got '$PWD'"
20
exit 1
21
fi