kubo/bin/check_go_path
Péter Szilágyi dbc1d3f2d3 Makefile, bin: Support multiple GOPATH components
License: MIT
Signed-off-by: Péter Szilágyi <peterke@gmail.com>
2016-07-16 18:06:16 -04:00

25 lines
421 B
Bash
Executable File

#!/bin/sh
PWD=$1
if [ -z "$PWD" ]; then
echo "must pass in your current working directory"
exit 1
fi
if [ -z "$GOPATH" ]; then
echo "GOPATH not set, you must have go configured properly to install ipfs"
exit 1
fi
while [ ${#} -gt 1 ]; do
if [ "$PWD" = "$2" ]; then
exit 0
fi
shift
done
echo "go-ipfs must be built from within your \$GOPATH directory."
echo "expected within '$GOPATH' but got '$PWD'"
exit 1