Removed extra HTTPDownloader folder creation call

This commit is contained in:
Justin Swanson 2019-12-21 19:30:56 -06:00
parent b392b667cf
commit cf73a2af2f

View File

@ -75,8 +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);
var parent = Directory.GetParent(destination);
if (download && !Directory.Exists(parent.FullName))
Directory.CreateDirectory(parent.FullName);
using (var fs = download ? File.OpenWrite(destination) : null)
{
@ -120,12 +121,6 @@ namespace Wabbajack.Lib.Downloaders
var contentSize = headerVar != null ? long.Parse(headerVar) : 1;
FileInfo fileInfo = new FileInfo(destination);
if (!fileInfo.Directory.Exists)
{
Directory.CreateDirectory(fileInfo.Directory.FullName);
}
using (var webs = stream)
{
var buffer = new byte[bufferSize];