Akagi201
5/26/2016 - 3:06 AM

build.sh

#!/bin/sh

time=`date '+%Y-%m-%d-%H:%M:%S'`
version=`git log -1 --oneline`
strip_version=${version// /-}

GOOS=darwin GOARCH=amd64 go build -ldflags "-X cmd.smkTime='${time}' -X cmd.smkVersion='${strip_version}' -s -w" -o smk_osx
GOOS=linux  GOARCH=amd64 go build -ldflags "-X cmd.smkTime='${time}' -X cmd.smkVersion='${strip_version}' -s -w" -o smk_linux
GOOS=windows GOARCH=386 go build -ldflags "-X cmd.smkTime='${time}' -X cmd.smkVersion='${strip_version}' -s -w" -o smk_win