refactor(bootstrap): migrate practice opponents to seed file
Move /practice/info handling out of GlobalsImporter into a dedicated PracticeOpponentImporter that reads a normalized JSON seed file generated by data_dumps/extract/extract-practice-opponents.ps1.
This commit is contained in:
@@ -76,6 +76,7 @@ public static class Program
|
||||
if (!opts.SkipGlobals)
|
||||
{
|
||||
await new GlobalsImporter().ImportAllAsync(context, opts.CapturesDir);
|
||||
await new PracticeOpponentImporter().ImportAsync(context, opts.SeedDir);
|
||||
|
||||
// BuildDeck pipeline: series CSV → catalog JSON → package CSV. Catalog must run after
|
||||
// series CSV (FK on products → series) and before package CSV (so the catalog-side
|
||||
@@ -152,6 +153,7 @@ public static class Program
|
||||
string refDir = referenceDataDir ?? shippedDataDir;
|
||||
string shippedStoryDir = Path.Combine(shippedDataDir, "story");
|
||||
string storyDir = storyDataDir ?? shippedStoryDir;
|
||||
string shippedSeedDir = Path.Combine(shippedDataDir, "seeds");
|
||||
|
||||
string connStr = connection
|
||||
?? Environment.GetEnvironmentVariable("NPGSQL_CONNECTION")
|
||||
@@ -159,7 +161,7 @@ public static class Program
|
||||
|
||||
return new BootstrapOptions(
|
||||
cardsFile, capturesDir, refDir, connStr, skipReference, skipCards, skipGlobals,
|
||||
skipStory, storyDir);
|
||||
skipStory, storyDir, shippedSeedDir);
|
||||
}
|
||||
|
||||
private static string NextArg(string[] args, ref int i)
|
||||
@@ -204,5 +206,6 @@ public static class Program
|
||||
bool SkipCards,
|
||||
bool SkipGlobals,
|
||||
bool SkipStory,
|
||||
string StoryDataDir);
|
||||
string StoryDataDir,
|
||||
string SeedDir);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user