main: handle glob errors in getFile (MR 22)

ignoring this was proooobably fine, but just in case...
This commit is contained in:
Clayton Craft
2022-09-15 16:15:49 -07:00
parent 7eed20e35f
commit 63495f3145

View File

@@ -255,7 +255,10 @@ func getFiles(list []string, required bool) (files []string, err error) {
func getFile(file string, required bool) (files []string, err error) {
// Expand glob expression
expanded, _ := filepath.Glob(file)
expanded, err := filepath.Glob(file)
if err != nil {
return
}
if len(expanded) > 0 && expanded[0] != file {
for _, path := range expanded {
if globFiles, err := getFile(path, required); err != nil {