build.bash: fail early if the go binary does not exist

This used to fail in an ugly way:

  $ ./build.bash
  ./build.bash: line 13: go: command not found
  ./build.bash: line 15: [: too many arguments
  ./build.bash: line 20: go: command not found
This commit is contained in:
Jakob Unterwurzacher 2016-06-14 22:56:28 +02:00
parent 393e531afd
commit a2c73cfde5
1 changed files with 3 additions and 0 deletions

View File

@ -9,6 +9,9 @@ GITVERSION=$(git describe --tags --dirty)
# go-fuse version according to git
GITVERSIONFUSE=$(cd $GOPATH/src/github.com/hanwen/go-fuse && git rev-parse --short HEAD)
# Make sure we have the go binary
go version > /dev/null
# go version go1.5.1 linux/amd64
V=$(go version | cut -d" " -f3 | cut -c3-5)