File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed
AssetRipper.NativeDialogs Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ namespace AssetRipper.NativeDialogs;
44
55internal 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}
You can’t perform that action at this time.
0 commit comments