diff --git a/src/Program.cs b/src/Program.cs index 399dc31..a956fbb 100644 --- a/src/Program.cs +++ b/src/Program.cs @@ -1,48 +1,48 @@ -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Serilog; -using System; -using System.Threading.Tasks; - +using System; +using System.Threading.Tasks; + namespace EpicMorg.Atlassian.Downloader -{ +{ public class Program { /// /// Atlassian archive downloader. See https://github.com/EpicMorg/atlassian-downloader for more info - /// + /// /// Action to perform - /// Override output directory to download. - /// Override URIs to import. - static async Task Main(string OutputDir = "atlassian", Uri[] customFeed = null, DownloadAction Action = DownloadAction.Download) => await - Host - .CreateDefaultBuilder() - .ConfigureHostConfiguration(configHost => configHost.AddEnvironmentVariables()) - .ConfigureAppConfiguration((ctx, configuration) => - configuration - .SetBasePath(Environment.CurrentDirectory) - .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) - .AddJsonFile($"appsettings.{ctx.HostingEnvironment.EnvironmentName}.json", optional: true, reloadOnChange: true) - .AddEnvironmentVariables()) - .ConfigureServices((ctx, services) => services - .AddOptions() + /// Override output directory to download. + /// Override URIs to import. + static async Task Main(string OutputDir = "atlassian", Uri[] customFeed = null, DownloadAction Action = DownloadAction.Download) => await + Host + .CreateDefaultBuilder() + .ConfigureHostConfiguration(configHost => configHost.AddEnvironmentVariables()) + .ConfigureAppConfiguration((ctx, configuration) => + configuration + .SetBasePath(Environment.CurrentDirectory) + .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) + .AddJsonFile($"appsettings.{ctx.HostingEnvironment.EnvironmentName}.json", optional: true, reloadOnChange: true) + .AddEnvironmentVariables()) + .ConfigureServices((ctx, services) => services + .AddOptions() .AddLogging(builder => - { - Log.Logger = new LoggerConfiguration() - .ReadFrom.Configuration(ctx.Configuration) - .CreateLogger(); - builder - .ClearProviders() - .AddSerilog(dispose: true); - }) - .AddHostedService() - .AddSingleton(new DownloaderOptions(OutputDir, customFeed, Action)) - .AddHttpClient()) - .RunConsoleAsync() + { + Log.Logger = new LoggerConfiguration() + .ReadFrom.Configuration(ctx.Configuration) + .CreateLogger(); + builder + .ClearProviders() + .AddSerilog(dispose: true); + }) + .AddHostedService() + .AddSingleton(new DownloaderOptions(OutputDir, customFeed, Action)) + .AddHttpClient()) + .RunConsoleAsync() .ConfigureAwait(false); - } + } } \ No newline at end of file