mirror of
https://github.com/RedWizardsLab/EchoHub.git
synced 2026-09-04 16:46:08 +02:00
feat: Enhance CI workflows to check for source and documentation changes, and cache NuGet packages
feat: Embed appsettings.json as a resource and update configuration loading logic
This commit is contained in:
@@ -5,9 +5,22 @@ using Microsoft.Extensions.Configuration;
|
||||
using Serilog;
|
||||
using Terminal.Gui.App;
|
||||
|
||||
var appSettingsPath = Path.Combine(AppContext.BaseDirectory, "appsettings.json");
|
||||
if (!File.Exists(appSettingsPath))
|
||||
{
|
||||
using var stream = typeof(AppOrchestrator).Assembly
|
||||
.GetManifestResourceStream("EchoHub.Client.appsettings.json");
|
||||
|
||||
if (stream is not null)
|
||||
{
|
||||
using var file = File.Create(appSettingsPath);
|
||||
stream.CopyTo(file);
|
||||
}
|
||||
}
|
||||
|
||||
var configuration = new ConfigurationBuilder()
|
||||
.SetBasePath(AppContext.BaseDirectory)
|
||||
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: false)
|
||||
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: false)
|
||||
.Build();
|
||||
|
||||
Log.Logger = new LoggerConfiguration()
|
||||
|
||||
Reference in New Issue
Block a user