Skip to content

Commit 44a5235

Browse files
committed
checksum: save them in a subdir .task/checksum
future-proof since the .task directory can be used to save other state in the future
1 parent 2022551 commit 44a5235

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

internal/status/checksum.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func (c *Checksum) IsUpToDate() (bool, error) {
3636
return false, nil
3737
}
3838

39-
_ = os.MkdirAll(filepath.Join(c.Dir, ".task"), 0755)
39+
_ = os.MkdirAll(filepath.Join(c.Dir, ".task", "checksum"), 0755)
4040
if err = ioutil.WriteFile(checksumFile, []byte(newMd5+"\n"), 0644); err != nil {
4141
return false, err
4242
}
@@ -76,7 +76,7 @@ func (c *Checksum) OnError() error {
7676
}
7777

7878
func (c *Checksum) checksumFilePath() string {
79-
return filepath.Join(c.Dir, ".task", c.normalizeFilename(c.Task))
79+
return filepath.Join(c.Dir, ".task", "checksum", c.normalizeFilename(c.Task))
8080
}
8181

8282
var checksumFilenameRegexp = regexp.MustCompile("[^A-z0-9]")

task_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ func TestStatusChecksum(t *testing.T) {
289289

290290
files := []string{
291291
"generated.txt",
292-
".task/build",
292+
".task/checksum/build",
293293
}
294294

295295
for _, f := range files {

0 commit comments

Comments
 (0)