kubo/bin/check_go_path
Jeromy 65519a0367 move gopath check to separate script and use realpath for symlink handling
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-02-23 22:26:37 -08:00

21 lines
449 B
Bash
Executable File

#!/bin/sh
if [ -z "$GOPATH" ]; then
echo "GOPATH not set, you must have go configured properly to install ipfs"
exit 1
fi
if ! type -f realpath > /dev/null; then
echo "program 'realpath' not found, it is required for this check"
exit 1
fi
PWD=$(pwd)
REALPWD=$(realpath "$PWD")
EXPECTED="$GOPATH/src/github.com/ipfs/go-ipfs"
if [ "$REALPWD" != "$EXPECTED" ]; then
echo "go-ipfs must be built from within your \$GOPATH directory."
exit 1
fi