Add pending runtime commit applicator
This commit is contained in:
parent
30e73a7b79
commit
5b60965dd7
5 changed files with 66 additions and 8 deletions
23
Aetheria.State.ApplyPending/Program.cs
Normal file
23
Aetheria.State.ApplyPending/Program.cs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
using Aetheria.State;
|
||||
|
||||
var root = args.Length > 0 && !args[0].StartsWith("--", StringComparison.Ordinal)
|
||||
? Path.GetFullPath(args[0])
|
||||
: Directory.GetCurrentDirectory();
|
||||
var explicitStatePath = args.Length > 1 && !args[1].StartsWith("--", StringComparison.Ordinal)
|
||||
? args[1]
|
||||
: "";
|
||||
var statePath = string.IsNullOrWhiteSpace(explicitStatePath)
|
||||
? AetheriaStatePaths.ResolveDefaultStatePath(root)
|
||||
: Path.GetFullPath(explicitStatePath);
|
||||
var deleteApplied = !args.Any(arg => string.Equals(arg, "--keep", StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
await using var node = await AetheriaStateNode.OpenAsync(statePath, "aetheria-state-apply-pending");
|
||||
var report = await AetheriaRuntimeCommitLogApplier.ApplyPendingAsync(node, deleteApplied);
|
||||
|
||||
Console.WriteLine($"Applied pending Aetheria runtime commits: {statePath}");
|
||||
Console.WriteLine($"Player settings: {report.AppliedPlayerSettings}");
|
||||
Console.WriteLine($"Loadout templates: {report.AppliedLoadoutTemplates}");
|
||||
Console.WriteLine($"Run checkpoints: {report.AppliedRunCheckpoints}");
|
||||
Console.WriteLine($"Commands applied: {report.AppliedPaths.Length}");
|
||||
if (!deleteApplied)
|
||||
Console.WriteLine("Applied command files were kept because --keep was supplied.");
|
||||
Loading…
Reference in a new issue