Skip to content

Commit 709674f

Browse files
committed
[r] move DI registration before console setup
1 parent 0ecf539 commit 709674f

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/EtcdTerminal.App/Program.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,25 @@
99
const string ShuttingDown = "[yellow]Shutting down...[/]";
1010
const string PressAnyKeyRestart = "\n[grey]Press any key to restart...[/]";
1111

12+
DIContainer.Current
13+
.RegisterAll()
14+
.Verify();
15+
1216
Console.OutputEncoding = System.Text.Encoding.UTF8;
1317
Console.Write(SetBgCommand);
1418

1519
Console.CancelKeyPress += (_, args) =>
1620
{
1721
args.Cancel = true;
22+
1823
Console.Write(ResetBgCommand);
1924
Console.ResetColor();
2025
Console.WriteLine();
2126
AnsiConsole.MarkupLine(ShuttingDown);
27+
2228
Environment.Exit(0);
2329
};
2430

25-
DIContainer.Current.RegisterAll()
26-
.Verify();
27-
2831
while (true)
2932
{
3033
try
@@ -38,6 +41,7 @@
3841
return;
3942

4043
var mainScreen = scope.Resolver.Resolve<MainScreen>();
44+
4145
await mainScreen.ShowAsync(config);
4246
}
4347
catch (Exception ex)

0 commit comments

Comments
 (0)