From 532c313855646cf7caf668d3fda5c80706d8ea01 Mon Sep 17 00:00:00 2001 From: xenolf Date: Sat, 9 Jan 2016 02:13:13 +0100 Subject: [PATCH] Allow for build time version override --- cli.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cli.go b/cli.go index 6f186c03..c07cf716 100644 --- a/cli.go +++ b/cli.go @@ -4,6 +4,7 @@ import ( "log" "os" "path" + "strings" "github.com/codegangsta/cli" "github.com/xenolf/lego/acme" @@ -20,11 +21,19 @@ func logger() *log.Logger { return Logger } +var gittag string + func main() { app := cli.NewApp() app.Name = "lego" app.Usage = "Let's encrypt client to go!" - app.Version = "0.1.0" + + version := "0.2.0" + if strings.HasPrefix(gittag, "v") { + version = gittag + } + + app.Version = version acme.UserAgent = "lego/" + app.Version