Update theme.go
This commit is contained in:
+1
-2
@@ -209,14 +209,13 @@ func (m *MyTheme) ListThemeFiles() map[string]string {
|
|||||||
pattern := filepath.Join(m.themeFileDir, "/*.toml")
|
pattern := filepath.Join(m.themeFileDir, "/*.toml")
|
||||||
files, err := filepath.Glob(pattern)
|
files, err := filepath.Glob(pattern)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Failed to glob files: %v", err)
|
log.Printf("Failed to glob files: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
result := make(map[string]string)
|
result := make(map[string]string)
|
||||||
for _, filePath := range files {
|
for _, filePath := range files {
|
||||||
// Clean the path to avoid issues with slashes
|
// Clean the path to avoid issues with slashes
|
||||||
cleanPath := filepath.Clean(filePath)
|
cleanPath := filepath.Clean(filePath)
|
||||||
log.Printf("Trying to read theme file: %s", cleanPath)
|
|
||||||
|
|
||||||
// Now read the theme file, using the cleaned path
|
// Now read the theme file, using the cleaned path
|
||||||
if themeFile, err := ReadThemeFile(cleanPath); err == nil {
|
if themeFile, err := ReadThemeFile(cleanPath); err == nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user