Adding proper buildDate, now through ldflags

This commit is contained in:
Harshavardhana
2015-04-27 13:08:04 -07:00
parent 4ba29a14f1
commit a5f63483bf
2 changed files with 6 additions and 1 deletions
+1 -1
View File
@@ -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:
+5
View File
@@ -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 {