Skip to content

Commit

Permalink
Merge pull request #491 from bilal-fazlani/ensure-awaits
Browse files Browse the repository at this point in the history
  • Loading branch information
drewburlingame authored Dec 9, 2023
2 parents 8e2fb71 + 558661b commit 3bf9556
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions CommandDotNet.TestTools/AppRunnerTestConfigExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static AppRunner InterceptSystemConsoleWrites(this AppRunner runner, Midd
middlewareStep ?? new MiddlewareStep(MiddlewareStages.Invoke, short.MinValue)));
}

private static Task<int> InterceptingSystemConsoleWrites(CommandContext context, ExecutionDelegate next)
private static async Task<int> InterceptingSystemConsoleWrites(CommandContext context, ExecutionDelegate next)
{
if (Console.Out is DuplexTextWriter)
{
Expand All @@ -49,7 +49,7 @@ private static Task<int> InterceptingSystemConsoleWrites(CommandContext context,
{
Console.SetOut(@out);
Console.SetError(error);
return next(context);
return await next(context);
}
finally
{
Expand Down
4 changes: 2 additions & 2 deletions CommandDotNet/Localization/CultureDirective.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ internal static AppRunner UseCultureDirective(AppRunner appRunner)
return appRunner.Configure(c => c.UseMiddleware(CheckCulture, MiddlewareSteps.DebugDirective + 1));
}

private static Task<int> CheckCulture(CommandContext context, ExecutionDelegate next)
private static async Task<int> CheckCulture(CommandContext context, ExecutionDelegate next)
{
Action? revert = null;

Expand All @@ -36,7 +36,7 @@ private static Task<int> CheckCulture(CommandContext context, ExecutionDelegate
CultureInfo.CurrentUICulture = cultureInfo;
}

var result = next(context);
var result = await next(context);

// revert for tests and interactive repl sessions
revert?.Invoke();
Expand Down

0 comments on commit 3bf9556

Please sign in to comment.