all repos

smutok @ 58b9b49

yet another tui rss reader (not abandoned, just paused development)
1 files changed, 5 insertions(+), 2 deletions(-)
feat: $APPNAME
Author: Oleksandr Smirnov olexsmir@gmail.com
Committed at: 2025-12-24 01:05:17 +0200
Change ID: wlllqryntvlxtpoosmkkmlvktqtyyxls
Parent: 725a325
M internal/config/config.go

@@ -9,10 +9,13 @@ "strings"

"github.com/adrg/xdg" "github.com/pelletier/go-toml/v2" + "olexsmir.xyz/x/envy" ) //go:embed config.toml var defaultConfig []byte + +var appName = envy.GetOrDefault("APPNAME", "smutok") var ( ErrUnsetPasswordEnv = errors.New("password env is unset")

@@ -75,7 +78,7 @@

func MustGetConfigFilePath() string { return mustGetConfigFile("config.toml") } func mustGetStateFile(file string) string { - stateFile, err := xdg.StateFile("smutok/" + file) + stateFile, err := xdg.StateFile(filepath.Join(appName, file)) if err != nil { panic(err) }

@@ -83,7 +86,7 @@ return stateFile

} func mustGetConfigFile(file string) string { - configFile, err := xdg.ConfigFile("smutok/" + file) + configFile, err := xdg.ConfigFile(filepath.Join(appName, file)) if err != nil { panic(err) }