Skip to content

Commit ea20a89

Browse files
committed
fix: make RunCommandLineApplicationAsync actually async
1 parent 6b822fc commit ea20a89

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

azure-pipelines.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ stages:
3636
displayName: Invoke build.ps1
3737
env:
3838
KEYVAULT_CLIENT_SECRET: $(kv-access-token)
39-
- powershell: .\docs\generate.ps1 -Verbose -NoBuild
40-
displayName: Compile documentation
4139
- task: PublishTestResults@2
4240
displayName: Upload test results
4341
condition: always()

src/Hosting.CommandLine/Internal/CommandLineService.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,11 @@ public CommandLineService(ILogger<CommandLineService<T>> logger, CommandLineStat
4444
}
4545

4646
/// <inheritdoc />
47-
public Task<int> RunAsync(CancellationToken cancellationToken)
47+
public async Task<int> RunAsync(CancellationToken cancellationToken)
4848
{
4949
_logger.LogDebug("Running");
50-
// TODO support cancellation tokens. See #111
51-
_state.ExitCode = _application.Execute(_state.Arguments);
52-
return Task.FromResult(_state.ExitCode);
50+
_state.ExitCode = await _application.ExecuteAsync(_state.Arguments, cancellationToken);
51+
return _state.ExitCode;
5352
}
5453

5554
public void Dispose()
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<Project>
2+
<PropertyGroup>
3+
<PackageReleaseNotes Condition="'$(VersionPrefix)' == '2.4.0'">
4+
Changes:
5+
* Support C# 8.0 and nullable reference types
6+
* RunCommandLineApplicationAsync is actually async now, not just sync disguised as an async API
7+
* Better CTRL+C support
8+
</PackageReleaseNotes>
9+
<PackageReleaseNotes>$(PackageReleaseNotes)
10+
11+
See more details here: https://github.com/natemcmaster/CommandLineUtils/blob/master/CHANGELOG.md#v$(VersionPrefix.Replace('.',''))
12+
</PackageReleaseNotes>
13+
</PropertyGroup>
14+
</Project>

0 commit comments

Comments
 (0)