1
0
mirror of https://github.com/go-task/task.git synced 2025-06-23 00:38:19 +02:00

Change patterns to slice to support multiple

This commit is contained in:
Andrey Nering
2017-02-27 17:03:25 -03:00
parent 0e1aaabf11
commit b8b52b94f9
2 changed files with 41 additions and 7 deletions

10
task.go
View File

@ -30,8 +30,8 @@ func init() {
type Task struct {
Cmds []string
Deps []string
Sources string
Generates string
Sources []string
Generates []string
}
type TaskNotFoundError struct {
@ -104,16 +104,16 @@ func RunTask(name string) error {
}
func isTaskUpToDate(t *Task) bool {
if t.Sources == "" || t.Generates == "" {
if len(t.Sources) == 0 || len(t.Generates) == 0 {
return false
}
sourcesMaxTime, err := maxTime(t.Sources)
sourcesMaxTime, err := getPatternsMaxTime(t.Sources)
if err != nil || sourcesMaxTime.IsZero() {
return false
}
generatesMinTime, err := minTime(t.Generates)
generatesMinTime, err := getPatternsMinTime(t.Generates)
if err != nil || generatesMinTime.IsZero() {
return false
}