mirror of
https://github.com/go-task/task.git
synced 2025-04-21 12:17:07 +02:00
Small improvements to #228
This commit is contained in:
parent
f5cd3eab9e
commit
0d9fdbaac1
@ -45,13 +45,16 @@ func (c *Checksum) IsUpToDate() (bool, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(c.Generates) != 0 {
|
if len(c.Generates) > 0 {
|
||||||
// For each specified 'generates' field, check whether the files actually exist.
|
// For each specified 'generates' field, check whether the files actually exist
|
||||||
for _, g := range c.Generates {
|
for _, g := range c.Generates {
|
||||||
generates, err := glob(c.Dir, g)
|
generates, err := glob(c.Dir, g)
|
||||||
if err != nil {
|
if os.IsNotExist(err) {
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
|
if err != nil {
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
if len(generates) == 0 {
|
if len(generates) == 0 {
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
|
@ -39,13 +39,12 @@ func glob(dir string, g string) ([]string, error) {
|
|||||||
for _, f := range fs {
|
for _, f := range fs {
|
||||||
info, err := os.Stat(f)
|
info, err := os.Stat(f)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
continue
|
return nil, err
|
||||||
}
|
}
|
||||||
if info.IsDir() {
|
if info.IsDir() {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
files = append(files, f)
|
files = append(files, f)
|
||||||
}
|
}
|
||||||
sort.Strings(files)
|
|
||||||
return files, nil
|
return files, nil
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user