Handle errors
This commit is contained in:
parent
6962a8273c
commit
229a5d2e57
|
@ -6488,19 +6488,30 @@ function install_gogs {
|
||||||
mkdir -p $GOPATH
|
mkdir -p $GOPATH
|
||||||
fi
|
fi
|
||||||
go get -u github.com/gpmgo/gopm
|
go get -u github.com/gpmgo/gopm
|
||||||
|
if [ ! "$?" = "0" ]; then
|
||||||
|
exit 479832
|
||||||
|
fi
|
||||||
|
|
||||||
# add a gogs user account
|
# add a gogs user account
|
||||||
adduser --disabled-login --gecos 'Gogs' git
|
adduser --disabled-login --gecos 'Gogs' git
|
||||||
|
|
||||||
# clone the repo
|
# clone the repo
|
||||||
|
if [ ! -d $GOPATH/src/github.com/gogits ]; then
|
||||||
mkdir -p $GOPATH/src/github.com/gogits
|
mkdir -p $GOPATH/src/github.com/gogits
|
||||||
|
fi
|
||||||
cd $GOPATH/src/github.com/gogits
|
cd $GOPATH/src/github.com/gogits
|
||||||
git clone https://github.com/gogits/gogs.git
|
git clone https://github.com/gogits/gogs.git
|
||||||
|
if [ ! "$?" = "0" ]; then
|
||||||
|
exit 78654
|
||||||
|
fi
|
||||||
cd gogs
|
cd gogs
|
||||||
|
|
||||||
# install
|
# install
|
||||||
go get ./...
|
go get ./...
|
||||||
go build
|
go build
|
||||||
|
if [ ! "$?" = "0" ]; then
|
||||||
|
exit 546750
|
||||||
|
fi
|
||||||
|
|
||||||
echo '#! /bin/sh' > /etc/init.d/gogs
|
echo '#! /bin/sh' > /etc/init.d/gogs
|
||||||
echo '### BEGIN INIT INFO' >> /etc/init.d/gogs
|
echo '### BEGIN INIT INFO' >> /etc/init.d/gogs
|
||||||
|
|
Loading…
Reference in New Issue