浏览代码

Handle errors

Bob Mottram 10 年前
父节点
当前提交
229a5d2e57
共有 1 个文件被更改,包括 12 次插入1 次删除
  1. 12
    1
      src/freedombone

+ 12
- 1
src/freedombone 查看文件

6488
       mkdir -p $GOPATH
6488
       mkdir -p $GOPATH
6489
   fi
6489
   fi
6490
   go get -u github.com/gpmgo/gopm
6490
   go get -u github.com/gpmgo/gopm
6491
+  if [ ! "$?" = "0" ]; then
6492
+      exit 479832
6493
+  fi
6491
 
6494
 
6492
   # add a gogs user account
6495
   # add a gogs user account
6493
   adduser --disabled-login --gecos 'Gogs' git
6496
   adduser --disabled-login --gecos 'Gogs' git
6494
 
6497
 
6495
   # clone the repo
6498
   # clone the repo
6496
-  mkdir -p $GOPATH/src/github.com/gogits
6499
+  if [ ! -d $GOPATH/src/github.com/gogits ]; then
6500
+      mkdir -p $GOPATH/src/github.com/gogits
6501
+  fi
6497
   cd $GOPATH/src/github.com/gogits
6502
   cd $GOPATH/src/github.com/gogits
6498
   git clone https://github.com/gogits/gogs.git
6503
   git clone https://github.com/gogits/gogs.git
6504
+  if [ ! "$?" = "0" ]; then
6505
+      exit 78654
6506
+  fi
6499
   cd gogs
6507
   cd gogs
6500
 
6508
 
6501
   # install
6509
   # install
6502
   go get ./...
6510
   go get ./...
6503
   go build
6511
   go build
6512
+  if [ ! "$?" = "0" ]; then
6513
+      exit 546750
6514
+  fi
6504
 
6515
 
6505
   echo '#! /bin/sh' > /etc/init.d/gogs
6516
   echo '#! /bin/sh' > /etc/init.d/gogs
6506
   echo '### BEGIN INIT INFO' >> /etc/init.d/gogs
6517
   echo '### BEGIN INIT INFO' >> /etc/init.d/gogs