Skip to content

Commit

Permalink
fix(cli): fix set console position for progress report (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabynevada authored Sep 5, 2023
1 parent 24a22d2 commit 2a74aeb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Biomatch.CLI/Biomatch.CLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Sep" Version="0.2.2" />
<PackageReference Include="Sep" Version="0.2.3" />
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
</ItemGroup>

Expand Down
7 changes: 6 additions & 1 deletion src/Biomatch.CLI/Progress/MatchingProgress.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ public static IProgress<int> GetMatchingProgressReport(int totalRecordsToMatch)
if (consoleTextPrinted)
{
Console.SetCursorPosition(0, Console.CursorTop - 2);
if (Console.CursorTop >= 2) {
Console.SetCursorPosition(0, Console.CursorTop - 2);
}
else {
Console.SetCursorPosition(0, 0);
}
}
Console.Write($"""
Progress: {currentPercentage,3}% | Record match operations performed: {completedOperations:N0}
Expand Down
2 changes: 1 addition & 1 deletion src/Biomatch.Domain/Biomatch.Domain.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="libphonenumber-csharp" Version="8.13.18" />
<PackageReference Include="libphonenumber-csharp" Version="8.13.19" />
<PackageReference Include="Quickenshtein" Version="1.5.1"/>
<PackageReference Include="SymSpell" Version="6.7.2"/>
<PackageReference Include="System.Private.Uri" Version="4.3.2"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.11.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.0" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
<PackageReference Include="xunit" Version="2.5.0" />
Expand Down

0 comments on commit 2a74aeb

Please sign in to comment.