Skip to content

Commit

Permalink
Shorten commit check
Browse files Browse the repository at this point in the history
Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com>
  • Loading branch information
rubo and LukaszRozmej authored Jun 3, 2024
1 parent f04857b commit 1978137
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 @@ -26,15 +26,13 @@ static ProductInfo()
OSArchitecture = RuntimeInformation.OSArchitecture.ToString().ToLowerInvariant();
Runtime = RuntimeInformation.FrameworkDescription;

var version = versionAttr.InformationalVersion;
var index = version.IndexOf('+', StringComparison.Ordinal);
Version = versionAttr.InformationalVersion;
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)];

Check failure on line 35 in src/Nethermind/Nethermind.Core/ProductInfo.cs

View workflow job for this annotation

GitHub Actions / Build (debug, Benchmarks)

The name 'version' does not exist in the current context

Check failure on line 35 in src/Nethermind/Nethermind.Core/ProductInfo.cs

View workflow job for this annotation

GitHub Actions / Build (debug, Benchmarks)

The name 'version' does not exist in the current context

Check failure on line 35 in src/Nethermind/Nethermind.Core/ProductInfo.cs

View workflow job for this annotation

GitHub Actions / Build (release, Benchmarks)

The name 'version' does not exist in the current context

Check failure on line 35 in src/Nethermind/Nethermind.Core/ProductInfo.cs

View workflow job for this annotation

GitHub Actions / Build (release, Benchmarks)

The name 'version' does not exist in the current context

Check failure on line 35 in src/Nethermind/Nethermind.Core/ProductInfo.cs

View workflow job for this annotation

GitHub Actions / Build (debug, Nethermind)

The name 'version' does not exist in the current context

Check failure on line 35 in src/Nethermind/Nethermind.Core/ProductInfo.cs

View workflow job for this annotation

GitHub Actions / Build (debug, Nethermind)

The name 'version' does not exist in the current context

Check failure on line 35 in src/Nethermind/Nethermind.Core/ProductInfo.cs

View workflow job for this annotation

GitHub Actions / Build (release, Nethermind)

The name 'version' does not exist in the current context

Check failure on line 35 in src/Nethermind/Nethermind.Core/ProductInfo.cs

View workflow job for this annotation

GitHub Actions / Build (release, Nethermind)

The name 'version' does not exist in the current context
}

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

0 comments on commit 1978137

Please sign in to comment.