Skip to content

Commit 769e25f

Browse files
committed
Consider task up-to-date on equal timestamps
Fixes issue #48 by considering a task up-to-date if the newest file from sources and the oldest file from generates has exactly the same time-stamp.
1 parent 86a2384 commit 769e25f

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

task.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,7 @@ func (e *Executor) isUpToDateTimestamp(ctx context.Context, call Call) (bool, er
250250
if err != nil || generatesMinTime.IsZero() {
251251
return false, nil
252252
}
253-
254-
return generatesMinTime.After(sourcesMaxTime), nil
253+
return !generatesMinTime.Before(sourcesMaxTime), nil
255254
}
256255

257256
func (e *Executor) runCommand(ctx context.Context, call Call, i int) error {

testdata/generates/Taskfile.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,5 @@ sub/src.txt:
2727
cmds:
2828
- mkdir -p sub
2929
- echo "hello world" > sub/src.txt
30-
# Sleep to avoid time-stamp issue. Some filesystems, E.g. HFS+ for Mac OS,
31-
# only support one second precision on file timestamps.
32-
- sleep 1
3330
status:
3431
- test -f sub/src.txt

0 commit comments

Comments
 (0)