Skip to content

Commit

Permalink
Add version info
Browse files Browse the repository at this point in the history
  • Loading branch information
russss committed Jan 15, 2017
1 parent 99c2f56 commit 9cfc774
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -28,7 +31,7 @@ type IRCCat struct {

func main() {
loggo.ConfigureLoggers("<root>=DEBUG")
log.Infof("IRCCat starting...")
log.Infof("IRCCat %s (%s) starting...", branch, revision)
viper.SetConfigName("irccat")
viper.AddConfigPath("/etc")
viper.AddConfigPath(".")
Expand Down

0 comments on commit 9cfc774

Please sign in to comment.