mirror of
https://github.com/Impostor/Impostor.git
synced 2026-10-20 01:46:11 +00:00
Print out version on startup
This commit is contained in:
1 parent
bde577db75
commit
57cce72df5
2 files changed
+21
-7
No files matched your search
@@ -1,8 +1,5 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Impostor.Api.Events.Managers;
|
||||
using Impostor.Api.Games;
|
||||
using Impostor.Api.Games.Managers;
|
||||
@@ -46,10 +43,7 @@ namespace Impostor.Server
|
||||
|
||||
try
|
||||
{
|
||||
// var assembly = Assembly.GetExecutingAssembly();
|
||||
// var fileVersion = FileVersionInfo.GetVersionInfo(assembly.Location);
|
||||
|
||||
Log.Information("Starting Impostor"); // v{0}", fileVersion.ProductVersion);
|
||||
Log.Information("Starting Impostor v{0}", DotnetUtils.GetVersion());
|
||||
CreateHostBuilder(args).Build().Run();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
using System.Reflection;
|
||||
|
||||
namespace Impostor.Server.Utils
|
||||
{
|
||||
internal static class DotnetUtils
|
||||
{
|
||||
private const string DefaultUnknownBuild = "UNKNOWN";
|
||||
|
||||
public static string GetVersion()
|
||||
{
|
||||
var attribute = typeof(DotnetUtils).Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>();
|
||||
if (attribute != null)
|
||||
{
|
||||
return attribute.InformationalVersion;
|
||||
}
|
||||
|
||||
return DefaultUnknownBuild;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user