ircd/install.sh

29 lines
774 B
Bash
Raw Normal View History

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