Skip to content
This repository has been archived by the owner on Nov 27, 2018. It is now read-only.

Commit

Permalink
Update ldflags syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
calmh committed Jun 20, 2017
1 parent b72e769 commit 3a1360e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
#!/bin/bash
set -euo pipefail

BIN=ipfixcat
VER=$(git describe --always)

case "$1" in
pkg)
rm -f *.tar.gz *.zip
for GOARCH in amd64 386 ; do
for GOARCH in amd64 ; do
for GOOS in darwin linux freebsd solaris ; do
export GOOS
export GOARCH

NAME="$BIN-${VER}_$GOOS-$GOARCH"
rm -rf "$NAME" "$NAME.tar.gz" "$BIN" "$BIN.exe"
go build -ldflags "-X main.ipfixcatVersion ${VER}"
go build -ldflags "-X main.ipfixcatVersion=${VER}"

mkdir "$NAME"
cp *.ini ipfixcat "$NAME" && tar zcf "$NAME.tar.gz" "$NAME"
Expand All @@ -26,7 +27,7 @@ case "$1" in

NAME="$BIN-${VER}_$GOOS-$GOARCH"
rm -rf "$NAME" "$NAME.tar.gz" "$BIN" "$BIN.exe"
go build -ldflags "-X main.ipfixcatVersion ${VER}"
go build -ldflags "-X main.ipfixcatVersion=${VER}"

mkdir "$NAME"
cp *.ini ipfixcat.exe "$NAME" && zip -r "$NAME.zip" "$NAME"
Expand Down

0 comments on commit 3a1360e

Please sign in to comment.