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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user