Skip to content

Commit

Permalink
feat: version hint
Browse files Browse the repository at this point in the history
  • Loading branch information
GZTimeWalker committed Sep 11, 2022
1 parent 2a348f8 commit 2dcf774
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions GZCTF/CTFServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<AssemblyVersion>0.10.0</AssemblyVersion>
<Description>GZ::CTF $(VITE_APP_GIT_NAME)-$(VITE_APP_GIT_SHA) build at $(VITE_APP_BUILD_TIMESTAMP)</Description>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
Expand Down
7 changes: 5 additions & 2 deletions GZCTF/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using Serilog.Events;
using System.Text;
using System.Text.Json;
using System.Reflection;

var builder = WebApplication.CreateBuilder(args);

Expand Down Expand Up @@ -313,7 +314,9 @@ await context.Posts.AddAsync(new()

try
{
logger.SystemLog("服务器初始化", CTFServer.TaskStatus.Pending, LogLevel.Debug);
var version = Assembly.GetExecutingAssembly()
.GetCustomAttribute<AssemblyDescriptionAttribute>()?.Description;
logger.SystemLog($"服务器初始化: {version}", CTFServer.TaskStatus.Pending, LogLevel.Debug);
await app.RunAsync();
}
catch (Exception exception)
Expand All @@ -330,4 +333,4 @@ await context.Posts.AddAsync(new()
public partial class Program
{
public static bool IsTesting { get; set; }
}
}

0 comments on commit 2dcf774

Please sign in to comment.