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