diff --git a/Makefile b/Makefile index a9a573c6..89e7355d 100644 --- a/Makefile +++ b/Makefile @@ -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: diff --git a/main.go b/main.go index d665cbe2..84fbf83c 100644 --- a/main.go +++ b/main.go @@ -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 {