Handle errors

This commit is contained in:
Bob Mottram 2015-03-17 21:48:00 +00:00
parent 6962a8273c
commit 229a5d2e57
1 changed files with 12 additions and 1 deletions

View File

@ -6488,19 +6488,30 @@ function install_gogs {
mkdir -p $GOPATH
fi
go get -u github.com/gpmgo/gopm
if [ ! "$?" = "0" ]; then
exit 479832
fi
# add a gogs user account
adduser --disabled-login --gecos 'Gogs' git
# clone the repo
mkdir -p $GOPATH/src/github.com/gogits
if [ ! -d $GOPATH/src/github.com/gogits ]; then
mkdir -p $GOPATH/src/github.com/gogits
fi
cd $GOPATH/src/github.com/gogits
git clone https://github.com/gogits/gogs.git
if [ ! "$?" = "0" ]; then
exit 78654
fi
cd gogs
# install
go get ./...
go build
if [ ! "$?" = "0" ]; then
exit 546750
fi
echo '#! /bin/sh' > /etc/init.d/gogs
echo '### BEGIN INIT INFO' >> /etc/init.d/gogs