From 44a52359dc59b551b3b957d4a98f7a1cfb022668 Mon Sep 17 00:00:00 2001 From: Andrey Nering Date: Thu, 2 Nov 2017 10:37:02 -0200 Subject: [PATCH] checksum: save them in a subdir .task/checksum future-proof since the .task directory can be used to save other state in the future --- internal/status/checksum.go | 4 ++-- task_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/status/checksum.go b/internal/status/checksum.go index e8599b7c..00798a0c 100644 --- a/internal/status/checksum.go +++ b/internal/status/checksum.go @@ -36,7 +36,7 @@ func (c *Checksum) IsUpToDate() (bool, error) { return false, nil } - _ = os.MkdirAll(filepath.Join(c.Dir, ".task"), 0755) + _ = os.MkdirAll(filepath.Join(c.Dir, ".task", "checksum"), 0755) if err = ioutil.WriteFile(checksumFile, []byte(newMd5+"\n"), 0644); err != nil { return false, err } @@ -76,7 +76,7 @@ func (c *Checksum) OnError() error { } func (c *Checksum) checksumFilePath() string { - return filepath.Join(c.Dir, ".task", c.normalizeFilename(c.Task)) + return filepath.Join(c.Dir, ".task", "checksum", c.normalizeFilename(c.Task)) } var checksumFilenameRegexp = regexp.MustCompile("[^A-z0-9]") diff --git a/task_test.go b/task_test.go index 57c40b2e..354c6d03 100644 --- a/task_test.go +++ b/task_test.go @@ -289,7 +289,7 @@ func TestStatusChecksum(t *testing.T) { files := []string{ "generated.txt", - ".task/build", + ".task/checksum/build", } for _, f := range files {