Add func to return full version string
This commit is contained in:
parent
7c7117d8d6
commit
6c20033bcc
@ -23,7 +23,7 @@ import (
|
|||||||
func main() {
|
func main() {
|
||||||
app := &cli.App{
|
app := &cli.App{
|
||||||
Name: "apiary",
|
Name: "apiary",
|
||||||
Version: apiary.Version,
|
Version: apiary.FullVersion(),
|
||||||
Authors: []*cli.Author{
|
Authors: []*cli.Author{
|
||||||
{
|
{
|
||||||
Name: "Torjus Håkestad",
|
Name: "Torjus Håkestad",
|
||||||
|
10
version.go
10
version.go
@ -1,4 +1,14 @@
|
|||||||
package apiary
|
package apiary
|
||||||
|
|
||||||
|
import "fmt"
|
||||||
|
|
||||||
var Version = "v0.1.1"
|
var Version = "v0.1.1"
|
||||||
var Build string
|
var Build string
|
||||||
|
|
||||||
|
func FullVersion() string {
|
||||||
|
if Build != "" {
|
||||||
|
return fmt.Sprintf("%s-%s", Version, Build)
|
||||||
|
}
|
||||||
|
|
||||||
|
return Version
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user