From 001a6724ecb37489548823c869447a48d33b2b86 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Mon, 30 Dec 2013 09:02:18 -0500 Subject: [PATCH] Build artefacts in build dir --- .gitignore | 1 + build.sh | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index c91511084..f0dff5db5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ syncthing *.tar.gz +build diff --git a/build.sh b/build.sh index 6adc09ad0..6e7b8c9c1 100755 --- a/build.sh +++ b/build.sh @@ -3,17 +3,20 @@ version=$(git describe --always) go test ./... || exit 1 +mkdir -p build || exit 1 for goos in darwin linux freebsd ; do for goarch in amd64 386 ; do echo "$goos-$goarch" export GOOS="$goos" export GOARCH="$goarch" + export name="syncthing-$goos-$goarch" go build -ldflags "-X main.Version $version" \ - && mkdir -p "syncthing-$goos-$goarch" \ - && mv syncthing "syncthing-$goos-$goarch" \ - && cp syncthing.ini "syncthing-$goos-$goarch" \ - && tar zcf "syncthing-$goos-$goarch.tar.gz" "syncthing-$goos-$goarch" \ - && rm -r "syncthing-$goos-$goarch" + && mkdir -p "$name" \ + && mv syncthing "$name" \ + && cp syncthing.ini "$name" \ + && tar zcf "$name.tar.gz" "$name" \ + && rm -r "$name" \ + && mv "$name.tar.gz" build done done