Add phase 1 critical import tool

This commit is contained in:
2026-03-14 01:10:44 +01:00
parent 44af81cc38
commit f70d610c92
25 changed files with 851 additions and 166 deletions

View File

@@ -0,0 +1,34 @@
namespace RolemasterDb.ImportTool;
public sealed class RepositoryPaths
{
private RepositoryPaths(string rootPath)
{
RootPath = rootPath;
ManifestPath = Path.Combine(rootPath, "sources", "critical-import-manifest.json");
DefaultDatabasePath = Path.Combine(rootPath, "src", "RolemasterDb.App", "rolemaster.db");
ArtifactsRootPath = Path.Combine(rootPath, "artifacts", "import", "critical");
}
public string RootPath { get; }
public string ManifestPath { get; }
public string DefaultDatabasePath { get; }
public string ArtifactsRootPath { get; }
public static RepositoryPaths Discover()
{
var probe = new DirectoryInfo(Directory.GetCurrentDirectory());
while (probe is not null)
{
if (File.Exists(Path.Combine(probe.FullName, "RolemasterDB.slnx")))
{
return new RepositoryPaths(probe.FullName);
}
probe = probe.Parent;
}
throw new InvalidOperationException("Could not discover the repository root from the current directory.");
}
}