feat(installer): record data directory in install manifest
Write the resolved DbPath parent into the manifest so UninstallRunner can honour customised data locations instead of always assuming ~/.todo-app. Older manifests fall back to the default path.
This commit is contained in:
@@ -8,7 +8,8 @@ public sealed record InstallManifest(
|
||||
string Version,
|
||||
string InstallDir,
|
||||
string WorkerDir,
|
||||
DateTimeOffset InstalledAt);
|
||||
DateTimeOffset InstalledAt,
|
||||
string? DataDir = null);
|
||||
|
||||
public static class InstallManifestStore
|
||||
{
|
||||
|
||||
@@ -67,10 +67,13 @@ public sealed class UninstallRunner
|
||||
failures.Add($"install dir ({_context.InstallDirectory}): {err}");
|
||||
}
|
||||
|
||||
// 6) Delete ~/.todo-app (config + DB + logs) — only if user opted in.
|
||||
// 6) Delete data dir (config + DB + logs) — only if user opted in.
|
||||
// Prefer the manifest-recorded DataDir so a customised DbPath is honoured;
|
||||
// fall back to the default ~/.todo-app for older manifests.
|
||||
if (removeAppData)
|
||||
{
|
||||
var appData = Paths.AppDataRoot();
|
||||
var manifest = InstallManifestStore.TryRead(_context.InstallDirectory);
|
||||
var appData = manifest?.DataDir ?? Paths.AppDataRoot();
|
||||
if (Directory.Exists(appData))
|
||||
{
|
||||
progress.Report($"Deleting {appData}...");
|
||||
|
||||
Reference in New Issue
Block a user