mirror of
https://github.com/go-task/task.git
synced 2025-11-25 22:32:55 +02:00
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.
This commit is contained in:
committed by
Sindre Røkenes Myren
parent
86a23849e0
commit
769e25f080
3
task.go
3
task.go
@@ -250,8 +250,7 @@ func (e *Executor) isUpToDateTimestamp(ctx context.Context, call Call) (bool, er
|
|||||||
if err != nil || generatesMinTime.IsZero() {
|
if err != nil || generatesMinTime.IsZero() {
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
|
return !generatesMinTime.Before(sourcesMaxTime), nil
|
||||||
return generatesMinTime.After(sourcesMaxTime), nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *Executor) runCommand(ctx context.Context, call Call, i int) error {
|
func (e *Executor) runCommand(ctx context.Context, call Call, i int) error {
|
||||||
|
|||||||
3
testdata/generates/Taskfile.yml
vendored
3
testdata/generates/Taskfile.yml
vendored
@@ -27,8 +27,5 @@ sub/src.txt:
|
|||||||
cmds:
|
cmds:
|
||||||
- mkdir -p sub
|
- mkdir -p sub
|
||||||
- echo "hello world" > sub/src.txt
|
- echo "hello world" > sub/src.txt
|
||||||
# Sleep to avoid time-stamp issue. Some filesystems, E.g. HFS+ for Mac OS,
|
|
||||||
# only support one second precision on file timestamps.
|
|
||||||
- sleep 1
|
|
||||||
status:
|
status:
|
||||||
- test -f sub/src.txt
|
- test -f sub/src.txt
|
||||||
|
|||||||
Reference in New Issue
Block a user