1
0
mirror of https://github.com/go-task/task.git synced 2025-07-15 01:35:00 +02:00

fix: only rewrite checksum files if the checksum has changed

This commit is contained in:
Andrew Berry
2023-06-03 18:20:08 -04:00
committed by GitHub
parent 1936142042
commit 082cdcc358
2 changed files with 13 additions and 2 deletions

View File

@ -42,7 +42,7 @@ func (checker *ChecksumChecker) IsUpToDate(t *taskfile.Task) (bool, error) {
return false, nil
}
if !checker.dry {
if !checker.dry && oldMd5 != newMd5 {
_ = os.MkdirAll(filepathext.SmartJoin(checker.tempDir, "checksum"), 0o755)
if err = os.WriteFile(checksumFile, []byte(newMd5+"\n"), 0o644); err != nil {
return false, err