Skip to content

Commit ce36102

Browse files
committed
Fix compile error
1 parent 97beb1e commit ce36102

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

AssetRipper.NativeDialogs/ProcessExecutor.cs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ namespace AssetRipper.NativeDialogs;
44

55
internal static class ProcessExecutor
66
{
7-
public static async Task<string?> TryRun(string command, params ReadOnlySpan<string> arguments)
7+
public static Task<string?> TryRun(string command, params ReadOnlySpan<string> arguments)
88
{
99
Process p = new()
1010
{
@@ -18,13 +18,20 @@ internal static class ProcessExecutor
1818
{
1919
p.StartInfo.ArgumentList.Add(arg);
2020
}
21-
if (!p.Start())
21+
return TryRunProcess(p);
22+
23+
static async Task<string?> TryRunProcess(Process process)
2224
{
23-
return null;
24-
}
25+
if (!process.Start())
26+
{
27+
return null;
28+
}
2529

26-
string? path = p.StandardOutput.ReadLine();
27-
await p.WaitForExitAsync();
28-
return p.ExitCode == 0 ? path : null;
30+
string? path = process.StandardOutput.ReadLine();
31+
32+
await process.WaitForExitAsync();
33+
34+
return process.ExitCode == 0 ? path : null;
35+
}
2936
}
3037
}

0 commit comments

Comments
 (0)