diff --git a/build.sh b/build.sh index 392137fa0..55f020cb2 100755 --- a/build.sh +++ b/build.sh @@ -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