Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use async overloads #10293

Merged
merged 1 commit into from
Oct 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Docfx.Dotnet/DotnetApiCatalog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static async Task GenerateManagedReferenceYamlFiles(string configPath, Do
try
{
var configDirectory = Path.GetDirectoryName(Path.GetFullPath(configPath));
var config = JObject.Parse(File.ReadAllText(configPath));
var config = JObject.Parse(await File.ReadAllTextAsync(configPath));
if (config.TryGetValue("metadata", out var value))
{
Logger.Rules = config["rules"]?.ToObject<Dictionary<string, LogLevel>>();
Expand Down
2 changes: 1 addition & 1 deletion test/docfx.Snapshot.Tests/PercyTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public async Task SeedHtml()
Clean(samplePath);

using var process = Process.Start("dotnet", $"build \"{s_samplesDir}/seed/dotnet/assembly/BuildFromAssembly.csproj\"");
process.WaitForExit();
await process.WaitForExitAsync();

var docfxPath = Path.GetFullPath(OperatingSystem.IsWindows() ? "docfx.exe" : "docfx");
Assert.Equal(0, Exec(docfxPath, $"metadata {samplePath}/docfx.json"));
Expand Down
2 changes: 1 addition & 1 deletion test/docfx.Snapshot.Tests/SamplesTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public async Task Seed()
Clean(samplePath);

using var process = Process.Start("dotnet", $"build \"{s_samplesDir}/seed/dotnet/assembly/BuildFromAssembly.csproj\"");
process.WaitForExit();
await process.WaitForExitAsync();

if (Debugger.IsAttached)
{
Expand Down
4 changes: 2 additions & 2 deletions test/docfx.Tests/DocsetBuildTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ private static async Task<Dictionary<string, Func<string>>> Build(Dictionary<str
{
var filePath = Path.GetFullPath(Path.Combine(testDirectory, path));
Directory.CreateDirectory(Path.GetDirectoryName(filePath));
File.WriteAllText(filePath, content);
await File.WriteAllTextAsync(filePath, content);
}

if (!files.ContainsKey("docfx.json"))
{
File.WriteAllText($"{testDirectory}/docfx.json",
await File.WriteAllTextAsync($"{testDirectory}/docfx.json",
"""
{
"build": {
Expand Down