feat(installer): harden database init and service setup steps

- InitDatabaseStep: create DbPath parent directory so custom paths work
- RegisterServiceStep: pass obj= argument so ServiceAccount is honoured
- StartServiceStep: poll for RUNNING state so downstream steps don't race
This commit is contained in:
mika kuns
2026-04-23 13:07:16 +02:00
parent cc01871407
commit 31218fc205
3 changed files with 30 additions and 6 deletions

View File

@@ -1,3 +1,4 @@
using System.IO;
using ClaudeDo.Data;
using ClaudeDo.Installer.Core;
using Microsoft.EntityFrameworkCore;
@@ -15,6 +16,10 @@ public sealed class InitDatabaseStep : IInstallStep
var expandedPath = Paths.Expand(ctx.DbPath);
progress.Report($"Initializing database at {expandedPath}");
var parent = Path.GetDirectoryName(expandedPath);
if (!string.IsNullOrEmpty(parent))
Directory.CreateDirectory(parent);
var options = new DbContextOptionsBuilder<ClaudeDoDbContext>()
.UseSqlite($"Data Source={expandedPath}")
.Options;