Add build-time system config directory variable

This commit is contained in:
2025-06-21 18:01:08 +03:00
parent 3025fee2bb
commit ff087b196a
6 changed files with 13 additions and 11 deletions
+3 -3
View File
@@ -94,14 +94,14 @@ func readStyles() {
}
}
}
if stat, err := os.Stat("/etc/typer/styles/"); err == nil && stat.IsDir() {
entries, err := os.ReadDir("/etc/typer/styles/")
if stat, err := os.Stat(path.Join(sysconfdir, "typer/styles/")); err == nil && stat.IsDir() {
entries, err := os.ReadDir(path.Join(sysconfdir, "typer/styles/"))
if err != nil {
log.Fatalf("Could not read user style directory: %s", err)
}
for _, entry := range entries {
entryPath := path.Join("/etc/typer/styles/", entry.Name())
entryPath := path.Join(path.Join(sysconfdir, "typer/styles/"), entry.Name())
style, err := readStyleYamlFile(entryPath)
if err != nil {
log.Fatalf("Could not read style file (%s): %s", entryPath, err)