1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-12 10:55:20 +02:00
sap-jenkins-library/cmd/version.go
Oliver Nocon 9c1bd04752
Streamline step generation (#1142)
* Streamline step generation
* Include PR feedback, update DEVELOPMENT.md

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
2020-02-04 10:46:43 +01:00

29 lines
456 B
Go

package cmd
import (
"fmt"
"github.com/SAP/jenkins-library/pkg/telemetry"
)
// GitCommit ...
var GitCommit string
// GitTag ...
var GitTag string
func version(config versionOptions, telemetryData *telemetry.CustomData) {
gitCommit, gitTag := "<n/a>", "<n/a>"
if len(GitCommit) > 0 {
gitCommit = GitCommit
}
if len(GitTag) > 0 {
gitTag = GitTag
}
fmt.Printf("piper-version:\n commit: \"%s\"\n tag: \"%s\"\n", gitCommit, gitTag)
}