| 1 | diff --git a/mage/main.go b/mage/main.go
|
| 2 | index b51ea95..de95078 100644
|
| 3 | |
| 4 | |
| 5 | @@ -72,6 +72,9 @@ const (
|
| 6 |
|
| 7 | var debug = log.New(io.Discard, "DEBUG: ", log.Ltime|log.Lmicroseconds)
|
| 8 |
|
| 9 | +// distro* are optional -X ldflags for packaging builds without VCS metadata.
|
| 10 | +var distroTimestamp, distroCommit, distroGitTag string
|
| 11 | +
|
| 12 | //go:generate stringer -type=Command
|
| 13 |
|
| 14 | // Command tracks invocations of mage that run without targets or other flags.
|
| 15 | @@ -202,6 +205,15 @@ func doVersion(out *log.Logger) {
|
| 16 | }
|
| 17 | }
|
| 18 | }
|
| 19 | + if distroGitTag != "" {
|
| 20 | + gitTag = distroGitTag
|
| 21 | + }
|
| 22 | + if distroCommit != "" {
|
| 23 | + commitHash = distroCommit
|
| 24 | + }
|
| 25 | + if distroTimestamp != "" {
|
| 26 | + timestamp = distroTimestamp
|
| 27 | + }
|
| 28 | out.Println("Mage Build Tool", gitTag)
|
| 29 | out.Println("Build Date:", timestamp)
|
| 30 | out.Println("Commit:", commitHash)
|