1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-14 11:03:09 +02:00
sap-jenkins-library/cmd/version.go
2019-10-31 13:57:29 +01:00

29 lines
409 B
Go

package cmd
import (
"fmt"
)
// GitCommit ...
var GitCommit string
// GitTag ...
var GitTag string
func version(myVersionOptions versionOptions) error {
gitCommit, gitTag := "<n/a>", "<n/a>"
if len(GitCommit) > 0 {
gitCommit = GitCommit
}
if len(GitTag) > 0 {
gitTag = GitTag
}
_, err := fmt.Printf("piper-version:\n commit: \"%s\"\n tag: \"%s\"\n", gitCommit, gitTag)
return err
}