Skip to content

Commit adaca15

Browse files
author
Okeanij
committed
Added SunEngine logo to server console startup
1 parent dd679b6 commit adaca15

File tree

5 files changed

+40
-6
lines changed

5 files changed

+40
-6
lines changed

Client/src/components/SunEngineFooter.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<template>
88
<div class="sun-engine-footer">
9-
{{$tl("start")}} &nbsp;&nbsp; <a class="sun-engine-footer__link" href="https://sunengine.site">Sun Engine</a>
9+
{{$tl("start")}} &nbsp;&nbsp; <a class="sun-engine-footer__link" href="https://sunengine.site">SunEngine</a>
1010
</div>
1111
</template>
1212

Server/SunEngine.Cli/InfoPrinter.cs

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Diagnostics;
33
using System.Reflection;
4+
using System.Runtime.CompilerServices;
45

56
namespace SunEngine.Cli
67
{
@@ -11,10 +12,40 @@ public static class InfoPrinter
1112
/// </summary>
1213
public static void PrintNoArgumentsInfo()
1314
{
14-
Console.WriteLine(
15-
@"Valid startup arguments wasn't provided. To list available commands use ""help"" argument.");
15+
Console.WriteLine("Valid startup arguments wasn't provided. To list available commands use \"help\" argument.\n");
1616
}
1717

18+
public static void PrintStart()
19+
{
20+
PrintSunEngineLogo();
21+
PrintVersion2();
22+
Console.WriteLine();
23+
}
24+
25+
public static void PrintSunEngineLogo()
26+
{
27+
Console.ForegroundColor = ConsoleColor.DarkYellow;
28+
Console.WriteLine(@"
29+
______ ______
30+
/ ____) | ____) (_)
31+
( (___ _ _ ____ | |___ ____ ____ _ ____ _____
32+
\___ \| | | | _ \| ___) | _ \ / _ | | _ \| ___ |
33+
____) ) |_| | | | | |_____| | | ( (_| | | | | | ____|
34+
(______/|____/|_| |_|_______)_| |_|\___ |_|_| |_|_____)
35+
(_____|");
36+
37+
Console.ResetColor();
38+
}
39+
40+
public static void PrintVersion2()
41+
{
42+
Assembly assembly = Assembly.GetExecutingAssembly();
43+
FileVersionInfo fileVersionInfo = FileVersionInfo.GetVersionInfo(assembly.Location);
44+
string version = fileVersionInfo.ProductVersion;
45+
Console.ForegroundColor = ConsoleColor.DarkYellow;
46+
Console.WriteLine($" Version: {version}");
47+
Console.ResetColor();
48+
}
1849

1950
/// <summary>
2051
/// Print help on dotnet "dotnet SunEngine.dll help"

Server/SunEngine.Cli/Program.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ public static class Program
88
{
99
public static void Main(string[] args)
1010
{
11+
InfoPrinter.PrintStart();
12+
1113
StartupConfiguration config = new StartupConfiguration(args);
1214

1315
if (config.PrintHelp || config.PrintVersion)

Server/SunEngine.Cli/ServerStartup.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@ public void RunServer(StartupConfiguration startupConfiguration)
2020
IWebHostEnvironment env = (IWebHostEnvironment) webHost.Services.GetService(typeof(IWebHostEnvironment));
2121
IConfiguration conf = (IConfiguration) webHost.Services.GetService(typeof(IConfiguration));
2222

23-
InfoPrinter.PrintVersion();
2423
Startup.SetExceptionsMode(env, conf);
2524

2625
new InfrastructurePreparer((IConfigurationRoot) conf).DoAll();
2726

27+
Console.WriteLine();
28+
2829
webHost.Run();
2930
}
3031

Server/SunEngine.Core/Services/EmailSenderService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ protected async Task SendEmailAsync(
7676
{
7777
await client.SendMailAsync(mailMessage);
7878
}
79-
catch (Exception e)
79+
catch
8080
{
81-
81+
// ignored
8282
}
8383
}
8484
}

0 commit comments

Comments
 (0)