summaryrefslogtreecommitdiff
path: root/internal/config
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-07-24 12:26:23 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-07-24 12:26:23 +0200
commited34fd574b4fc2e0a52c655ececddd1be29b271e (patch)
tree8980a2b86ec279289abcabe3a691fa8a2a925765 /internal/config
parenta26fed000ad9f292618f9cecfd2b505dddfd004a (diff)
downloadlectio-ed34fd574b4fc2e0a52c655ececddd1be29b271e.tar.gz
lectio-ed34fd574b4fc2e0a52c655ececddd1be29b271e.zip
reader: lectio-ui --reader fuzzy book picker + chapter reader over the corpora; v0.8.0
Diffstat (limited to 'internal/config')
-rw-r--r--internal/config/config.go17
1 files changed, 16 insertions, 1 deletions
diff --git a/internal/config/config.go b/internal/config/config.go
index 8ee15e1..9a41adc 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -24,7 +24,7 @@ var seedTOML []byte
// Version is lectio's release version, shared by every binary's
// -v/--version output (lectio, lectio-ui, lectio-web).
-const Version = "0.7.0"
+const Version = "0.8.0"
// validVersions are the five scripture versions lectio understands.
var validVersions = map[string]bool{
@@ -203,6 +203,21 @@ func BooksPath() (string, error) {
return filepath.Join(filepath.Dir(p), "books.toml"), nil
}
+// UserBooksTOML returns the bytes of the optional user books.toml (see
+// BooksPath), or nil when it is absent or unreadable -- callers then fall back
+// to bible's embedded default table.
+func UserBooksTOML() []byte {
+ p, err := BooksPath()
+ if err != nil {
+ return nil
+ }
+ b, err := os.ReadFile(p)
+ if err != nil {
+ return nil
+ }
+ return b
+}
+
// seedIfMissing writes the embedded default config to path if nothing is
// there yet.
func seedIfMissing(path string) error {