diff --git a/.travis.yml b/.travis.yml index f839928..80b6eeb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,8 +7,9 @@ script: - "! gofmt -d . | read" - go test -v ./... before_deploy: +- rm -Rf ./dist - go get github.com/mitchellh/gox -- gox -os="linux darwin" -arch="amd64 386" -output="dist/{{.OS}}_{{.Arch}}_{{.Dir}}" +- gox -ldflags="-X main.branch=$TRAVIS_TAG -X main.revision=$TRAVIS_COMMIT" -os="linux darwin" -arch="amd64 386" -output="dist/{{.OS}}_{{.Arch}}_{{.Dir}}" deploy: provider: releases skip_cleanup: true diff --git a/main.go b/main.go index 857ccde..a48227a 100644 --- a/main.go +++ b/main.go @@ -17,6 +17,9 @@ import ( var log = loggo.GetLogger("main") +var branch string +var revision string + type IRCCat struct { auth_channel string channels mapset.Set @@ -28,7 +31,7 @@ type IRCCat struct { func main() { loggo.ConfigureLoggers("=DEBUG") - log.Infof("IRCCat starting...") + log.Infof("IRCCat %s (%s) starting...", branch, revision) viper.SetConfigName("irccat") viper.AddConfigPath("/etc") viper.AddConfigPath(".")