github.com/ezbuy/gauge@v0.9.4-0.20171013092048-7ac5bd3931cd/build/run.sh (about)

     1  # Copyright 2015 ThoughtWorks, Inc.
     2  
     3  # This file is part of Gauge.
     4  
     5  # Gauge is free software: you can redistribute it and/or modify
     6  # it under the terms of the GNU General Public License as published by
     7  # the Free Software Foundation, either version 3 of the License, or
     8  # (at your option) any later version.
     9  
    10  # Gauge is distributed in the hope that it will be useful,
    11  # but WITHOUT ANY WARRANTY; without even the implied warranty of
    12  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    13  # GNU General Public License for more details.
    14  
    15  # You should have received a copy of the GNU General Public License
    16  # along with Gauge.  If not, see <http://www.gnu.org/licenses/>.
    17  
    18  if [[ -z $GOPATH ]]; then
    19      export GOPATH=`pwd`
    20  fi
    21  if [[ -z $GOBIN ]]; then
    22      export GOBIN="$GOPATH/bin"
    23  fi
    24  
    25  setup(){
    26      cd $GOPATH/src/github.com/getgauge/gauge
    27      go get github.com/tools/godep && $GOBIN/godep restore
    28  }
    29  
    30  option="${1}"
    31  case ${option} in
    32      test)
    33          setup
    34          go test ./... -v
    35          ;;
    36      build|"")
    37          setup
    38          go run build/make.go
    39          ;;
    40      *)
    41          echo "`basename ${0}`:usage: [build|test]"
    42          exit 1
    43          ;;
    44  esac