diff --git a/internal/status/checksum.go b/internal/status/checksum.go index 653a8e35..572d4650 100644 --- a/internal/status/checksum.go +++ b/internal/status/checksum.go @@ -45,13 +45,16 @@ func (c *Checksum) IsUpToDate() (bool, error) { } } - if len(c.Generates) != 0 { - // For each specified 'generates' field, check whether the files actually exist. + if len(c.Generates) > 0 { + // For each specified 'generates' field, check whether the files actually exist for _, g := range c.Generates { generates, err := glob(c.Dir, g) - if err != nil { + if os.IsNotExist(err) { return false, nil } + if err != nil { + return false, err + } if len(generates) == 0 { return false, nil } diff --git a/internal/status/glob.go b/internal/status/glob.go index b46f7616..a70f663d 100644 --- a/internal/status/glob.go +++ b/internal/status/glob.go @@ -10,7 +10,7 @@ import ( "github.com/mattn/go-zglob" ) -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) @@ -39,13 +39,12 @@ func glob(dir string, g string) ([]string, error) { for _, f := range fs { info, err := os.Stat(f) if err != nil { - continue + return nil, err } if info.IsDir() { continue } files = append(files, f) } - sort.Strings(files) return files, nil }