Generated by AurionDocs
Job ID: 934f8c39-8082-4942-8d17-72ed8f5f8d50
Source commit: 40aea9a
1.5 KiB
Program
File:
src/EchoHub.Client/Program.cs
Kind: file
The Program file serves as the entry point for the EchoHub client. It bootstraps startup by handling a potential CLI rollback (--rollback), performing a best-effort Unix execute-permission check, provisioning configuration (loading from appsettings.json with a fallback embedded resource at EchoHub.Client.appsettings.example.json), and configuring Serilog from the configuration before loading the runtime settings via ConfigManager and initializing the Terminal.Gui UI with Application.Create().Init().
Remarks
This file centralizes environment preparation and startup orchestration, encapsulating cross-platform concerns (rollback handling, permission checks, path setup, and post-update housekeeping) so the rest of the application can assume a ready, consistent runtime context. It also exposes a clear, testable bootstrap path that wires configuration, logging, and the UI startup in a single phase, reducing duplication across modules.
Notes
- Rolling back can terminate startup early because
UpdateBackupService.RestoreBackup()or subsequent error paths invokeEnvironment.Exit. - Unix permission checks are best-effort and any failures are swallowed to avoid blocking startup on platform quirks.
- The initial configuration may be sourced from an embedded resource (
EchoHub.Client.appsettings.example.json) ifappsettings.jsonis absent, providing a safe fallback during first-run scenarios.