Browse Source

Add version info

tags/v0.1.3
Russ Garrett 7 years ago
parent
commit
9cfc7743bc
No account linked to committer's email address
2 changed files with 6 additions and 2 deletions
  1. 2
    1
      .travis.yml
  2. 4
    1
      main.go

+ 2
- 1
.travis.yml View File

@@ -7,8 +7,9 @@ script:
7 7
 - "! gofmt -d . | read"
8 8
 - go test -v ./...
9 9
 before_deploy:
10
+- rm -Rf ./dist
10 11
 - go get github.com/mitchellh/gox
11
-- gox -os="linux darwin" -arch="amd64 386" -output="dist/{{.OS}}_{{.Arch}}_{{.Dir}}"
12
+- gox -ldflags="-X main.branch=$TRAVIS_TAG -X main.revision=$TRAVIS_COMMIT" -os="linux darwin" -arch="amd64 386" -output="dist/{{.OS}}_{{.Arch}}_{{.Dir}}"
12 13
 deploy:
13 14
   provider: releases
14 15
   skip_cleanup: true

+ 4
- 1
main.go View File

@@ -17,6 +17,9 @@ import (
17 17
 
18 18
 var log = loggo.GetLogger("main")
19 19
 
20
+var branch string
21
+var revision string
22
+
20 23
 type IRCCat struct {
21 24
 	auth_channel string
22 25
 	channels     mapset.Set
@@ -28,7 +31,7 @@ type IRCCat struct {
28 31
 
29 32
 func main() {
30 33
 	loggo.ConfigureLoggers("<root>=DEBUG")
31
-	log.Infof("IRCCat starting...")
34
+	log.Infof("IRCCat %s (%s) starting...", branch, revision)
32 35
 	viper.SetConfigName("irccat")
33 36
 	viper.AddConfigPath("/etc")
34 37
 	viper.AddConfigPath(".")

Loading…
Cancel
Save