Skip to content

Commit

Permalink
Shorten commit check
Browse files Browse the repository at this point in the history
  • Loading branch information
rubo committed Jun 3, 2024
1 parent f04857b commit ecfd954
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/Nethermind/Nethermind.Core/ProductInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,14 @@ static ProductInfo()
OS = Platform.GetPlatformName();
OSArchitecture = RuntimeInformation.OSArchitecture.ToString().ToLowerInvariant();
Runtime = RuntimeInformation.FrameworkDescription;
Version = versionAttr.InformationalVersion;

var version = versionAttr.InformationalVersion;
var index = version.IndexOf('+', StringComparison.Ordinal);
var index = Version.IndexOf('+', StringComparison.Ordinal);

if (index == -1)
Version = version;
else
if (index != -1)
{
Commit = version[(index + 1)..];
Version = version[..Math.Min(index + 9, version.Length - 1)];
Commit = Version[(index + 1)..];
Version = Version[..Math.Min(index + 9, Version.Length - 1)];
}

ClientId = $"{Name}/v{Version}/{OS.ToLowerInvariant()}-{OSArchitecture}/dotnet{Runtime[5..]}";
Expand Down

0 comments on commit ecfd954

Please sign in to comment.