From 562d03bb7ccc9aad288a6f647762582782054dcb Mon Sep 17 00:00:00 2001 From: Andreas Neue Date: Sun, 24 Jan 2016 15:48:28 +0100 Subject: [PATCH] genbuilddate.sh, announce date in version info. --- Makefile | 7 +++++-- genbuilddate.sh | 9 +++++++++ main.go | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) create mode 100755 genbuilddate.sh diff --git a/Makefile b/Makefile index b0d5854..4924d7c 100644 --- a/Makefile +++ b/Makefile @@ -3,15 +3,18 @@ export GOPATH default: build -build: test genversion +build: test genversion genbuilddate go build -v flokatirc build-win: test genversion - GOOS=windows GOARCH=amd64 go build -v -o ./build/bin/flokatirc.exe flokatirc + GOOS=windows GOARCH=amd64 go build -v -o flokatirc.exe flokatirc genversion: ./genversion.sh +genbuilddate: + ./genbuilddate.sh + fmt: go fmt ./... diff --git a/genbuilddate.sh b/genbuilddate.sh new file mode 100755 index 0000000..0100a4e --- /dev/null +++ b/genbuilddate.sh @@ -0,0 +1,9 @@ +#!/bin/sh +BUILDDATEGO="version/builddate.go" +echo "package version" >$BUILDDATEGO +echo "" >>$BUILDDATEGO +echo "const (" >>$BUILDDATEGO +echo -n " FlokatiBuilddate = \"" >>$BUILDDATEGO +echo -n `date` >>$BUILDDATEGO +echo "\"" >>$BUILDDATEGO +echo ")" >>$BUILDDATEGO diff --git a/main.go b/main.go index 299937f..8a299fe 100644 --- a/main.go +++ b/main.go @@ -165,5 +165,5 @@ func HandleMessage(m *irc.Message) { } func SoftwareInfo() string { - return fmt.Sprintf("flokatirc %s-%s", version.FlokatiVersion, version.FlokatiBuild) + return fmt.Sprintf("flokatirc %s-%s (built %s)", version.FlokatiVersion, version.FlokatiBuild, version.FlokatiBuilddate) }