2019-03-01 00:47:27 +00:00
|
|
|
#!/bin/sh
|
2019-02-21 03:29:39 -05:00
|
|
|
|
2019-02-21 05:43:15 -05:00
|
|
|
set -e
|
|
|
|
|
2019-02-21 03:29:39 -05:00
|
|
|
if [ -z "$GOPATH" ]; then
|
2019-02-21 16:20:03 -05:00
|
|
|
echo Error: \$GOPATH is unset
|
|
|
|
echo See https://golang.org/doc/code.html for details, or try these steps:
|
2019-02-28 20:02:46 -05:00
|
|
|
printf "\tmkdir -p ~/go\n"
|
|
|
|
printf "\texport GOPATH=~/go\n"
|
2019-02-21 03:29:39 -05:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
EXPECTED_DIR=${GOPATH}/src/github.com/oragono/oragono
|
|
|
|
|
2019-02-21 16:20:03 -05:00
|
|
|
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:
|
2019-02-28 20:02:46 -05:00
|
|
|
printf "\tmkdir -p %s/src/github.com/oragono\n" "$GOPATH"
|
|
|
|
printf "\tcd %s/src/github.com/oragono\n" "$GOPATH"
|
|
|
|
printf "\tmv %s oragono\n" "$PWD"
|
|
|
|
printf "\tcd oragono\n"
|
2019-02-21 03:29:39 -05:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
go install -v
|
2019-02-28 20:02:46 -05:00
|
|
|
echo successfully installed as "${GOPATH}/bin/oragono"
|