From ac7443e462cb0b198c038c0ad1ece5ccfea615e5 Mon Sep 17 00:00:00 2001
From: Florent <florent.gluck@hesge.ch>
Date: Thu, 2 Jan 2025 20:27:03 +0100
Subject: [PATCH] server: support links to template directories

---
 src/common/utils/files.go | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/common/utils/files.go b/src/common/utils/files.go
index e83cab5..a4a0bb3 100644
--- a/src/common/utils/files.go
+++ b/src/common/utils/files.go
@@ -114,7 +114,7 @@ func GetSubDirs(dir string) ([]string, error) {
 	}
 
 	// Retrieves all files entries in the directory (0 = all files in the directory).
-	files, err := currentDir.Readdir(0)
+	files, err := currentDir.ReadDir(0)
 	if err != nil {
 		currentDir.Close()
 		return nil, err
@@ -124,7 +124,8 @@ func GetSubDirs(dir string) ([]string, error) {
 
 	// Loop over file entries
 	for _, f := range files {
-		if f.IsDir() {
+		info, _ := f.Info()
+		if f.IsDir() || info.Mode()&os.ModeSymlink != 0 {
 			subDirs = append(subDirs, filepath.Join(dir, f.Name()))
 		}
 	}
-- 
GitLab