forked from TrueCloudLab/lego
Allow for build time version override
This commit is contained in:
parent
9c099c8739
commit
532c313855
1 changed files with 10 additions and 1 deletions
11
cli.go
11
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
|
||||
|
||||
|
|
Loading…
Reference in a new issue