3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-12-23 03:02:48 +01:00
ergo/install.sh

29 lines
774 B
Bash
Raw Normal View History

#!/bin/sh
2019-02-21 09:29:39 +01:00
set -e
2019-02-21 09:29:39 +01: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 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
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"