Replace os.Stat call with FileSystem.Exists

This commit is contained in:
Francesc Campoy
2021-07-16 09:27:20 -07:00
parent 436d5e717c
commit 927568eea2

View File

@@ -328,11 +328,8 @@ func (r *LocalPackageReader) shouldSkipDir(path string, matcher *ignoreFilesMatc
return nil
}
// check if this is a subpackage
_, err := os.Stat(filepath.Join(path, r.PackageFileName))
if os.IsNotExist(err) {
if !r.FileSystem.Exists(filepath.Join(path, r.PackageFileName)) {
return nil
} else if err != nil {
return errors.Wrap(err)
}
if !r.IncludeSubpackages {
return filepath.SkipDir