From 86fac519a5c8e6c0d2335fcc97c34404dd19a3ae Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Fri, 25 Oct 2024 16:10:39 +0200 Subject: [PATCH] Fix handling of subgroups in GetDescriptionNames. --- group/description.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/group/description.go b/group/description.go index 2cf8478..043c682 100644 --- a/group/description.go +++ b/group/description.go @@ -556,11 +556,13 @@ func GetDescriptionNames() ([]string, error) { if base[0] == '.' { return nil } - if strings.HasSuffix(base, ".json") { - names = append(names, strings.TrimSuffix( - base, ".json", - )) + p, err := filepath.Rel(Directory, path) + if err != nil || !strings.HasSuffix(p, ".json") { + return nil } + names = append(names, strings.TrimSuffix( + p, ".json", + )) return nil }, )