diff --git a/core/handlers/init.go b/core/handlers/init.go index d86c2d5..bf35334 100644 --- a/core/handlers/init.go +++ b/core/handlers/init.go @@ -2,8 +2,6 @@ package handlers import ( "encoding/json" - "log/slog" - "github.com/KristianJBorgwarth/dendrite.daemon/config" "github.com/KristianJBorgwarth/dendrite.daemon/core/rpc" "github.com/KristianJBorgwarth/dendrite.daemon/persistence" @@ -30,7 +28,6 @@ type InitializeHandler struct{} func (h InitializeHandler) Handle(raw json.RawMessage) (any, *rpc.Error) { var params initializeCommand - slog.Info("initializing with params", "params", string(raw)) if err := json.Unmarshal(raw, ¶ms); err != nil { return nil, &rpc.Error{ Code: -32602, diff --git a/dendrite b/dendrite index 0118eac..8eda9ac 100755 Binary files a/dendrite and b/dendrite differ diff --git a/persistence/db_migrator.go b/persistence/db_migrator.go index c17d0a6..2de7a75 100644 --- a/persistence/db_migrator.go +++ b/persistence/db_migrator.go @@ -4,6 +4,7 @@ import ( "database/sql" "embed" "log/slog" + "os" "path/filepath" "sort" ) @@ -12,7 +13,14 @@ import ( var migrationsFS embed.FS func InitializeIndex(vaultPath string) error { - dbPath := filepath.Join(vaultPath, "index.db") + indexDir := filepath.Join(vaultPath, ".index") + + if err := os.MkdirAll(indexDir, 0755); err != nil { + slog.Error("failed to create index directory", "error", err) + return err + } + + dbPath := filepath.Join(indexDir, "index.db") db, err := sql.Open("sqlite", dbPath) if err != nil {