Kinds: check for entries length (#104231)

This commit is contained in:
Matias Chomicki 2025-06-12 14:10:57 +02:00 committed by GitHub
parent 3c6da3f241
commit 5a34447ad9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -173,6 +173,9 @@ func loadCueFiles(ctx *cue.Context, dirs []os.DirEntry) ([]codegen.SchemaForGen,
os.Exit(1) os.Exit(1)
} }
if len(entries) == 0 {
continue
}
// It's assuming that we only have one file in each folder // It's assuming that we only have one file in each folder
entry := filepath.Join(dir.Name(), entries[0].Name()) entry := filepath.Join(dir.Name(), entries[0].Name())
cueFile, err := os.ReadFile(entry) cueFile, err := os.ReadFile(entry)