From 773e3c8cd9da654b0b4bf5e725d9e536fb02408a Mon Sep 17 00:00:00 2001
From: Andrey Petrov <andrey.petrov@shazow.net>
Date: Sun, 17 Jul 2016 17:58:57 -0400
Subject: [PATCH] Fix release script

---
 Makefile      | 8 ++++----
 build_release | 3 +++
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 18f87df..31b2384 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@ KEY = host_key
 PORT = 2022
 
 SRCS = %.go
-VERSION := $(shell git describe --long --tags --dirty --always)
+VERSION := $(shell git describe --tags --dirty --always)
 LDFLAGS = LDFLAGS="-X main.Version=$(VERSION)"
 
 all: $(BINARY)
@@ -33,6 +33,6 @@ test:
 	golint ./...
 
 release:
-	ENV=GOOS=linux GOARCH=amd64 $(LDFLAGS) ./build_release "github.com/shazow/ssh-chat/cmd/ssh-chat" README.md LICENSE
-	ENV=GOOS=linux GOARCH=386 $(LDFLAGS) ./build_release "github.com/shazow/ssh-chat/cmd/ssh-chat" README.md LICENSE
-	ENV=GOOS=darwin GOARCH=amd64 $(LDFLAGS) ./build_release "github.com/shazow/ssh-chat/cmd/ssh-chat" README.md LICENSE
+	GOOS=linux GOARCH=amd64 $(LDFLAGS) ./build_release "github.com/shazow/ssh-chat/cmd/ssh-chat" README.md LICENSE
+	GOOS=linux GOARCH=386 $(LDFLAGS) ./build_release "github.com/shazow/ssh-chat/cmd/ssh-chat" README.md LICENSE
+	GOOS=darwin GOARCH=amd64 $(LDFLAGS) ./build_release "github.com/shazow/ssh-chat/cmd/ssh-chat" README.md LICENSE
diff --git a/build_release b/build_release
index 2a0831c..00d4c35 100755
--- a/build_release
+++ b/build_release
@@ -16,12 +16,15 @@ main() {
 
     if [[ ! "$GOOS" ]]; then
         export GOOS="linux"
+        echo "Defaulting to GOOS=$GOOS"
     fi
     if [[ ! "$GOARCH" ]]; then
         export GOARCH="amd64"
+        echo "Defaulting to GOARCH=$GOARCH"
     fi
     if [[ ! "$BUILDDIR" ]]; then
         export BUILDDIR="build"
+        echo "Defaulting to BUILDDIR=$BUILDDIR"
     fi
 
     build "$@"