File tree Expand file tree Collapse file tree 1 file changed +15
-17
lines changed
tools-local/tasks/Microsoft.DotNet.SourceBuild.Tasks.XPlat Expand file tree Collapse file tree 1 file changed +15
-17
lines changed Original file line number Diff line number Diff line change @@ -30,30 +30,28 @@ public class ParseDotNetVersions : Task
30
30
31
31
public override bool Execute ( )
32
32
{
33
-
34
33
var pathToDotNet = Path . Join ( SdkRootDirectory , "dotnet" ) ;
34
+
35
35
SdkVersion = ExecuteDotNetCommand ( SdkRootDirectory ,
36
36
pathToDotNet ,
37
37
new List < string > { "--list-sdks" } )
38
38
. First ( )
39
39
. Split ( " " )
40
40
. First ( ) ;
41
- AspNetCoreVersion = ExecuteDotNetCommand ( SdkRootDirectory ,
42
- pathToDotNet ,
43
- new List < string > { "--list-runtimes" } )
44
- . Where ( line => line . Contains ( "Microsoft.AspNetCore.App" ) )
45
- . First ( )
46
- . Split ( " " )
47
- . Skip ( 1 )
48
- . First ( ) ;
49
- RuntimeVersion = ExecuteDotNetCommand ( SdkRootDirectory ,
50
- pathToDotNet ,
51
- new List < string > { "--list-runtimes" } )
52
- . Where ( line => line . Contains ( "Microsoft.NETCore.App" ) )
53
- . First ( )
54
- . Split ( " " )
55
- . Skip ( 1 )
56
- . First ( ) ;
41
+
42
+ var runtimesOutput = ExecuteDotNetCommand ( SdkRootDirectory ,
43
+ pathToDotNet ,
44
+ new List < string > { "--list-runtimes" } ) ;
45
+
46
+ AspNetCoreVersion = runtimesOutput
47
+ . First ( line => line . Contains ( "Microsoft.AspNetCore.App" ) )
48
+ . Split ( " " )
49
+ . ElementAt ( 1 ) ;
50
+
51
+ RuntimeVersion = runtimesOutput
52
+ . First ( line => line . Contains ( "Microsoft.NETCore.App" ) )
53
+ . Split ( " " )
54
+ . ElementAt ( 1 ) ;
57
55
58
56
return true ;
59
57
}
You can’t perform that action at this time.
0 commit comments