Do go get as part of build unless fast build requested (fixes #31)

This commit is contained in:
Jakob Borg 2014-01-09 21:22:05 +01:00
parent 6e11e3cda9
commit a18f6c6d90
1 changed files with 11 additions and 5 deletions

View File

@ -3,21 +3,27 @@
version=$(git describe --always)
buildDir=dist
if [[ -z $1 ]] ; then
if [[ $1 == "-f" ]] ; then
fast=yes
shift
fi
if [[ $fast != yes ]] ; then
go get
go test ./...
fi
if [[ -z $1 ]] ; then
go build -ldflags "-X main.Version $version" \
&& nrsc syncthing gui
elif [[ $1 == "tar" ]] ; then
go test ./...
go build -ldflags "-X main.Version $version" \
&& nrsc syncthing gui \
&& mkdir syncthing-dist \
&& cp syncthing README.md LICENSE syncthing-dist \
&& tar zcvf syncthing-dist.tar.gz syncthing-dist \
&& rm -rf syncthing-dist
else
go test ./... || exit 1
elif [[ $1 == "all" ]] ; then
rm -rf "$buildDir"
mkdir -p "$buildDir" || exit 1