Skip to content
Snippets Groups Projects
Commit 0ee19d2b authored by Martin Finkel's avatar Martin Finkel
Browse files

fix warning, don't use WebClient

parent 7d8ff4b9
No related branches found
No related tags found
No related merge requests found
......@@ -149,13 +149,18 @@ async Task DownloadArtifact(string arch)
Console.WriteLine("Found the nightly artifact URL");
using (var webClient = new WebClient())
using (var httpClient = new HttpClient())
{
url = $"{baseUrl}{arch}/{todayPartialLink}{todayLinkEnding}";
Console.WriteLine($"requesting {url}");
webClient.DownloadProgressChanged += (s, e) => Console.Write($"\r{e.ProgressPercentage}%");
await webClient.DownloadFileTaskAsync(url, $"../artifacts/{artifact}{ext}");
using (var stream = await httpClient.GetStreamAsync(url))
{
using (var fs = new FileStream($"../artifacts/{artifact}{ext}", FileMode.CreateNew))
{
await stream.CopyToAsync(fs);
}
}
Console.WriteLine(Environment.NewLine);
Console.WriteLine("Done...");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment