Skip to content

Commit

Permalink
feat(Startup): Update display version handling
Browse files Browse the repository at this point in the history
- Updated the code in Startup.cs to handle the display version.
- The code now splits the full version string and uses only the first part for display.
  • Loading branch information
SakuraIsayeki committed Feb 24, 2024
1 parent 167ef62 commit 8654dc9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 5 additions & 1 deletion WowsKarma.Api/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ public Startup(IConfiguration configuration)
{
Configuration = configuration;
ApiRegion = Common.Utilities.GetRegionConfigString(Configuration["Api:CurrentRegion"] ?? "EU");
DisplayVersion = typeof(Startup).Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()!.InformationalVersion;

if (typeof(Startup).Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()!.InformationalVersion is { } fullVersion)
{
DisplayVersion = fullVersion.Split('+').First();
}
}


Expand Down
5 changes: 1 addition & 4 deletions WowsKarma.Api/WowsKarma.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,11 @@
<PackageProjectUrl>https://wows-karma.com</PackageProjectUrl>
<RepositoryUrl>https://github.com/SakuraIsayeki/WoWS-Karma</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>

<UserSecretsId>8247eff5-32cd-4d58-ae32-52f2201e69c5</UserSecretsId>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<StartupObject>WowsKarma.Api.Program</StartupObject>
<ApplicationInsightsResourceId>/subscriptions/0be2b8e4-3496-4846-848e-778692007b69/resourceGroups/WOWS-Karma/providers/microsoft.insights/components/wows-karma-api</ApplicationInsightsResourceId>
<SignAssembly>false</SignAssembly>


<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);1591</NoWarn>
</PropertyGroup>
Expand Down

0 comments on commit 8654dc9

Please sign in to comment.