fix folder parsing issue specific to Azure environment where WebRootPath contains 2 wwwroot nested folders

This commit is contained in:
Shaun Walker 2020-10-22 16:30:27 -04:00
parent cbd7caa6df
commit cdb7de84fa
2 changed files with 5 additions and 5 deletions

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
@ -103,7 +103,7 @@ namespace Oqtane.Infrastructure
assets.Add(filename);
break;
case "wwwroot":
filename = Path.Combine(webRootPath.Replace(Path.DirectorySeparatorChar + "wwwroot", ""), Utilities.PathCombine(entry.FullName.Split('/')));
filename = Path.Combine(webRootPath, Utilities.PathCombine(entry.FullName.Replace("wwwroot/", "").Split('/')));
ExtractFile(entry, filename);
assets.Add(filename);
break;

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
@ -58,7 +58,7 @@ namespace Oqtane.Upgrade
files.Add(Path.Combine(binfolder, filename));
break;
case "wwwroot":
files.Add(Path.Combine(webrootfolder.Replace(Path.DirectorySeparatorChar + "wwwroot", ""), entry.FullName.Replace('/', Path.DirectorySeparatorChar)));
files.Add(Path.Combine(webrootfolder, entry.FullName.Replace("wwwroot/", "").Replace('/', Path.DirectorySeparatorChar)));
break;
}
}
@ -102,7 +102,7 @@ namespace Oqtane.Upgrade
filename = Path.Combine(binfolder, filename);
break;
case "wwwroot":
filename = Path.Combine(webrootfolder.Replace(Path.DirectorySeparatorChar + "wwwroot", ""), entry.FullName.Replace('/', Path.DirectorySeparatorChar));
filename = Path.Combine(webrootfolder, entry.FullName.Replace("wwwroot/", "").Replace('/', Path.DirectorySeparatorChar));
break;
}
if (files.Contains(filename))