Skip to content

Commit

Permalink
Update NuGet packages
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyrrrz committed Apr 24, 2021
1 parent d1b70cf commit e7c2564
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 21 deletions.
4 changes: 2 additions & 2 deletions DiscordChatExporter.Cli/DiscordChatExporter.Cli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CliFx" Version="2.0.3" />
<PackageReference Include="Spectre.Console" Version="0.38.0" />
<PackageReference Include="CliFx" Version="2.0.4" />
<PackageReference Include="Spectre.Console" Version="0.39.0" />
<PackageReference Include="Gress" Version="1.2.0" />
<PackageReference Include="Tyrrrz.Extensions" Version="1.6.5" />
</ItemGroup>
Expand Down
29 changes: 10 additions & 19 deletions DiscordChatExporter.Cli/Utils/Extensions/ConsoleExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,26 @@ namespace DiscordChatExporter.Cli.Utils.Extensions
{
internal static class ConsoleExtensions
{
public static IAnsiConsole CreateAnsiConsole(this IConsole console)
{
var ansiConsole = AnsiConsole.Create(
new AnsiConsoleSettings
{
Ansi = AnsiSupport.Detect,
ColorSystem = ColorSystemSupport.Detect,
Out = console.Output
}
);

// HACK: https://github.com/spectresystems/spectre.console/pull/318
ansiConsole.Profile.Encoding = console.Output.Encoding;

return ansiConsole;
}
public static IAnsiConsole CreateAnsiConsole(this IConsole console) => AnsiConsole.Create(
new AnsiConsoleSettings
{
Ansi = AnsiSupport.Detect,
ColorSystem = ColorSystemSupport.Detect,
Out = new AnsiConsoleOutput(console.Output)
}
);

public static Progress CreateProgressTicker(this IConsole console) => console
.CreateAnsiConsole()
.Progress()
.AutoClear(false)
.AutoRefresh(true)
.HideCompleted(false)
.Columns(new ProgressColumn[]
{
.Columns(
new TaskDescriptionColumn {Alignment = Justify.Left},
new ProgressBarColumn(),
new PercentageColumn()
});
);

public static async ValueTask StartTaskAsync(
this ProgressContext progressContext,
Expand Down

0 comments on commit e7c2564

Please sign in to comment.