improved error messages from walking someone through the steps

This commit is contained in:
Shivaram Lingamneni 2019-02-21 16:20:03 -05:00
parent 4af56f2dae
commit 98ab3d14ee
1 changed files with 13 additions and 3 deletions

View File

@ -3,14 +3,24 @@
set -e
if [ -z "$GOPATH" ]; then
echo \$GOPATH is unset: see https://golang.org/doc/code.html for details
echo Error: \$GOPATH is unset
echo See https://golang.org/doc/code.html for details, or try these steps:
echo -e "\tmkdir -p ~/go"
echo -e "\texport GOPATH=~/go"
exit 1
fi
EXPECTED_DIR=${GOPATH}/src/github.com/oragono/oragono
if [ `pwd` != "$EXPECTED_DIR" ] ; then
echo working checkout is not where \$GOPATH expects it: should be $EXPECTED_DIR
if [ "$PWD" != "$EXPECTED_DIR" ] ; then
echo Error: working directory is not where \$GOPATH expects it to be
echo "Expected: $EXPECTED_DIR"
echo "Actual: $PWD"
echo See https://golang.org/doc/code.html for details, or try these steps:
echo -e "\tmkdir -p ${GOPATH}/src/github.com/oragono"
echo -e "\tcd ${GOPATH}/src/github.com/oragono"
echo -e "\tmv $PWD oragono"
echo -e "\tcd oragono"
exit 1
fi