grype/internal/file/exists.go

16 lines
199 B
Go
Raw Normal View History

2020-06-19 14:12:29 +00:00
package file
import (
"os"
"github.com/spf13/afero"
)
func Exists(fs afero.Fs, path string) bool {
info, err := fs.Stat(path)
if os.IsNotExist(err) {
return false
}
return !info.IsDir()
}