From 98ab3d14ee41b33e0cc3eabf35c20c86372073c5 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Thu, 21 Feb 2019 16:20:03 -0500 Subject: [PATCH] improved error messages from walking someone through the steps --- install.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 5da12cb1..96d60781 100755 --- a/install.sh +++ b/install.sh @@ -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