feat(path): support for XDG base directories (#95)

closes #93
This commit is contained in:
VERSE
2026-07-31 22:58:09 +07:00
committed by GitHub
parent aba4dc9716
commit bf75dc239b
2 changed files with 19 additions and 2 deletions
+3 -2
View File
@@ -11,6 +11,7 @@ import (
"sync"
"time"
"github.com/versenilvis/iris/internal/config"
_ "modernc.org/sqlite"
)
@@ -37,11 +38,11 @@ type FrecencyStore struct {
func NewFrecencyStore(dbPath string) (*FrecencyStore, error) {
if dbPath == "" {
home, err := os.UserHomeDir()
var err error
dbPath, err = config.HistoryDBPath()
if err != nil {
return nil, err
}
dbPath = filepath.Join(home, ".local", "share", "iris", "history.db")
}
dir := filepath.Dir(dbPath)