Skip to content

Commit

Permalink
Create testtrack directory when generating build timestamp (#54)
Browse files Browse the repository at this point in the history
* Create testtrack directory when generating build timestamp

* Bump testtrack-cli to 1.1.1
  • Loading branch information
aburgel authored Apr 9, 2020
1 parent cbead5c commit d6dd547
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SHELL = /bin/sh

VERSION=1.1.0
VERSION=1.1.1
BUILD=`git rev-parse HEAD`

LDFLAGS=-ldflags "-w -s \
Expand Down
6 changes: 6 additions & 0 deletions cmds/generate_build_timestamp.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cmds

import (
"io/ioutil"
"os"
"time"

"github.com/spf13/cobra"
Expand Down Expand Up @@ -30,5 +31,10 @@ var generateBuildTimestampCmd = &cobra.Command{
func generateBuildTimestamp() error {
timestamp := []byte(time.Now().UTC().Format("2006-01-02T15:04:05Z"))

err := os.MkdirAll("testtrack", 0755)
if err != nil {
return err
}

return ioutil.WriteFile("testtrack/build_timestamp", timestamp, 0644)
}

0 comments on commit d6dd547

Please sign in to comment.