Merge pull request #291 from tr4wzified/downloader-fix

Fix error on HTTPDownloader trying to download to non-existing destinations
This commit is contained in:
Timothy Baldridge 2019-12-18 08:09:44 -07:00 committed by GitHub
commit 3184cdc793
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -75,6 +75,9 @@ namespace Wabbajack.Lib.Downloaders
public async Task<bool> DoDownload(Archive a, string destination, bool download)
{
if (download && !Directory.Exists(Directory.GetParent(destination).FullName))
Directory.CreateDirectory(Directory.GetParent(destination).FullName);
using (var fs = download ? File.OpenWrite(destination) : null)
{
var client = Client ?? new HttpClient();