Skip to content

Commit

Permalink
fix: showing version in UI
Browse files Browse the repository at this point in the history
  • Loading branch information
ktos committed Nov 19, 2024
1 parent 28c912c commit 597e7ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Server/Components/Pages/GamePage.razor
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
</div>
<div class="dialogueWindowBg">
<div class="dialogueWindow">
Fracture @VersionInfoProvider.ShortVersion<br />
Fracture @VersionInfoProvider.InformationalVersion<br />
tutaj log mojej gry<br />
<PopupContainer @ref="_popup"></PopupContainer>
</div>
Expand Down
10 changes: 3 additions & 7 deletions Server/Modules/Shared/VersionInfoProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@ class VersionInfoProvider
{
public VersionInfoProvider()
{
InformationalVersion =
Assembly
.GetEntryAssembly()
?.GetCustomAttribute<AssemblyInformationalVersionAttribute>()
?.InformationalVersion ?? string.Empty;

ShortVersion = InformationalVersion.Substring(0, InformationalVersion.IndexOf(".Branch"));
var lines = File.ReadAllLines("version.txt");
ShortVersion = lines[0];
InformationalVersion = $"{lines[0]}-{lines[1]}";
}

public string InformationalVersion { get; init; }
Expand Down

0 comments on commit 597e7ae

Please sign in to comment.