Add func to return full version string

This commit is contained in:
Torjus Håkestad 2021-04-12 08:58:39 +02:00
parent 7c7117d8d6
commit 6c20033bcc
2 changed files with 11 additions and 1 deletions

View File

@ -23,7 +23,7 @@ import (
func main() {
app := &cli.App{
Name: "apiary",
Version: apiary.Version,
Version: apiary.FullVersion(),
Authors: []*cli.Author{
{
Name: "Torjus Håkestad",

View File

@ -1,4 +1,14 @@
package apiary
import "fmt"
var Version = "v0.1.1"
var Build string
func FullVersion() string {
if Build != "" {
return fmt.Sprintf("%s-%s", Version, Build)
}
return Version
}