From da3fe68f7e2a6ad9ad5c82d567aea64c3c0e1595 Mon Sep 17 00:00:00 2001 From: Parsa Rostami Date: Wed, 20 Mar 2024 16:25:53 +1100 Subject: [PATCH] Add --no-logo cli arg for not showing the logo --- src/Mockaco/Startup.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Mockaco/Startup.cs b/src/Mockaco/Startup.cs index 89032ec..ece1e3a 100644 --- a/src/Mockaco/Startup.cs +++ b/src/Mockaco/Startup.cs @@ -3,12 +3,11 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using System.Reflection; -using Mockaco.Templating.Generating; +using System; +using System.Linq; namespace Mockaco { - using Settings; - public partial class Startup { private readonly IConfiguration _configuration; @@ -29,9 +28,15 @@ public void Configure(IApplicationBuilder app, ILogger logger) { var assemblyName = Assembly.GetExecutingAssembly().GetName().Name; var version = GitVersionInformation.InformationalVersion; + var isNoLogoPassed = Environment.GetCommandLineArgs().Contains("--no-logo"); + + var logMessage = "{assemblyName} v{assemblyVersion} [github.com/natenho/Mockaco]"; + + if (!isNoLogoPassed) + logMessage += "\n\n{logo}"; + + logger.LogInformation(logMessage, assemblyName, version, _logo); - logger.LogInformation("{assemblyName} v{assemblyVersion} [github.com/natenho/Mockaco]\n\n{logo}", assemblyName, version, _logo); - app .UseCors() .UseMockaco();