The very basic client app, not adapted for mobiles.
Some checks failed
Linting and tests / Linting (push) Failing after 5s
Linting and tests / Tests (push) Failing after 4s

This commit is contained in:
2025-09-10 19:34:49 +05:00
parent b65b8a9e72
commit e3b9c9ae40
50 changed files with 2816 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
package database
import (
"fmt"
"log/slog"
"os"
"path/filepath"
"bunker/commons"
)
func (d *database) configureDBPath() error {
rootDir, err := os.UserConfigDir()
if err != nil {
return fmt.Errorf("configure DB path: get config dir: %w", err)
}
rootDir = filepath.Join(rootDir, commons.ClientAppID)
//nolint:mnd
if err := os.MkdirAll(rootDir, 0o700); err != nil {
return fmt.Errorf("configure DB path: create dir: %w", err)
}
d.dbPath = filepath.Join(rootDir, "database.sqlite3")
slog.Info("Database path configured.", "path", d.dbPath)
return nil
}