Adding proper buildDate, now through ldflags
This commit is contained in:
@@ -60,7 +60,7 @@ env:
|
||||
|
||||
install: test-all
|
||||
@echo "Installing mc:"
|
||||
@godep go install -ldflags "-X main.Version `git rev-parse HEAD`" github.com/minio-io/mc
|
||||
@godep go install -a -ldflags "-X main.BuildDate `date '+%FT%T.%N%:z'`" github.com/minio-io/mc
|
||||
@mkdir -p $(HOME)/.mc
|
||||
|
||||
clean:
|
||||
|
||||
@@ -23,6 +23,7 @@ import (
|
||||
"os/user"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/cheggaaa/pb"
|
||||
"github.com/minio-io/cli"
|
||||
@@ -81,11 +82,15 @@ func getSystemData() map[string]string {
|
||||
// Version is based on MD5SUM of its binary
|
||||
var Version = mustHashBinarySelf()
|
||||
|
||||
// Build date
|
||||
var BuildDate string
|
||||
|
||||
func main() {
|
||||
app := cli.NewApp()
|
||||
app.Usage = "Mini Copy for object storage and filesystems"
|
||||
app.Version = Version
|
||||
app.Commands = commands
|
||||
app.Compiled, _ = time.Parse(time.RFC3339Nano, BuildDate)
|
||||
app.Flags = flags
|
||||
app.Author = "Minio.io"
|
||||
app.Before = func(ctx *cli.Context) error {
|
||||
|
||||
Reference in New Issue
Block a user