From e7c2564f6fcc1741a4b3273851b26791213008aa Mon Sep 17 00:00:00 2001 From: Tyrrrz Date: Sat, 24 Apr 2021 21:08:57 +0300 Subject: [PATCH] Update NuGet packages --- .../DiscordChatExporter.Cli.csproj | 4 +-- .../Utils/Extensions/ConsoleExtensions.cs | 29 +++++++------------ 2 files changed, 12 insertions(+), 21 deletions(-) diff --git a/DiscordChatExporter.Cli/DiscordChatExporter.Cli.csproj b/DiscordChatExporter.Cli/DiscordChatExporter.Cli.csproj index 8497178e6..2143b2810 100644 --- a/DiscordChatExporter.Cli/DiscordChatExporter.Cli.csproj +++ b/DiscordChatExporter.Cli/DiscordChatExporter.Cli.csproj @@ -6,8 +6,8 @@ - - + + diff --git a/DiscordChatExporter.Cli/Utils/Extensions/ConsoleExtensions.cs b/DiscordChatExporter.Cli/Utils/Extensions/ConsoleExtensions.cs index c871abef2..c834650ab 100644 --- a/DiscordChatExporter.Cli/Utils/Extensions/ConsoleExtensions.cs +++ b/DiscordChatExporter.Cli/Utils/Extensions/ConsoleExtensions.cs @@ -7,22 +7,14 @@ 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() @@ -30,12 +22,11 @@ public static Progress CreateProgressTicker(this IConsole console) => console .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,