Skip to content

Commit c623aa7

Browse files
committed
Add DotNetReleasesHandler
1 parent 59ee658 commit c623aa7

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
using System;
1+
using System;
2+
using System.Linq;
3+
using System.Net.Http;
4+
using System.Threading;
5+
using System.Threading.Tasks;
26
using Microsoft.Deployment.DotNet.Releases;
37

48
namespace Microsoft.DotNet.Tools.Bootstrapper;
59

610
internal static class DotNetReleasesHandler
711
{
8-
internal static Uri[] DotNetReleasesIndexFeeds = new Uri[]
12+
public static async Task<Product> GetChannelAsync(string channelVersion)
913
{
10-
new("https://builds.dotnet.microsoft.com/dotnet/release-metadata/releases-index.json"),
11-
new("https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/2.1/releases.json")
12-
};
13-
14-
internal static Uri DotNetRelesesMetadataFeed(string channelVersion) =>
15-
new($"https://builds.dotnet.microsoft.com/dotnet/release-metadata/{channelVersion}/releases.json");
14+
ProductCollection productCollection = await ProductCollection.GetAsync();
15+
return productCollection.FirstOrDefault((Product product) => product.ProductVersion.Equals(channelVersion));
16+
}
1617
}

0 commit comments

Comments
 (0)