1
0
mirror of https://github.com/go-task/task.git synced 2025-08-10 22:42:19 +02:00

feat: for

This commit is contained in:
Pete Davison
2023-06-15 15:04:03 +00:00
committed by Andrey Nering
parent 7ece04e996
commit 7ff1b1795e
12 changed files with 387 additions and 12 deletions

View File

@@ -10,7 +10,7 @@ import (
"github.com/go-task/task/v3/internal/filepathext"
)
func globs(dir string, globs []string) ([]string, error) {
func Globs(dir string, globs []string) ([]string, error) {
files := make([]string, 0)
for _, g := range globs {
f, err := Glob(dir, g)

View File

@@ -84,7 +84,7 @@ func (*ChecksumChecker) Kind() string {
}
func (c *ChecksumChecker) checksum(t *taskfile.Task) (string, error) {
sources, err := globs(t.Dir, t.Sources)
sources, err := Globs(t.Dir, t.Sources)
if err != nil {
return "", err
}

View File

@@ -28,11 +28,11 @@ func (checker *TimestampChecker) IsUpToDate(t *taskfile.Task) (bool, error) {
return false, nil
}
sources, err := globs(t.Dir, t.Sources)
sources, err := Globs(t.Dir, t.Sources)
if err != nil {
return false, nil
}
generates, err := globs(t.Dir, t.Generates)
generates, err := Globs(t.Dir, t.Generates)
if err != nil {
return false, nil
}
@@ -90,7 +90,7 @@ func (checker *TimestampChecker) Kind() string {
// Value implements the Checker Interface
func (checker *TimestampChecker) Value(t *taskfile.Task) (any, error) {
sources, err := globs(t.Dir, t.Sources)
sources, err := Globs(t.Dir, t.Sources)
if err != nil {
return time.Now(), err
}