From cdb7de84fa90c467e7647d58050444ef5bb1482f Mon Sep 17 00:00:00 2001 From: Shaun Walker Date: Thu, 22 Oct 2020 16:30:27 -0400 Subject: [PATCH] fix folder parsing issue specific to Azure environment where WebRootPath contains 2 wwwroot nested folders --- Oqtane.Server/Infrastructure/InstallationManager.cs | 4 ++-- Oqtane.Upgrade/Program.cs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Oqtane.Server/Infrastructure/InstallationManager.cs b/Oqtane.Server/Infrastructure/InstallationManager.cs index 0063f5bf..00fb0895 100644 --- a/Oqtane.Server/Infrastructure/InstallationManager.cs +++ b/Oqtane.Server/Infrastructure/InstallationManager.cs @@ -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; diff --git a/Oqtane.Upgrade/Program.cs b/Oqtane.Upgrade/Program.cs index af2665e0..d9a042ce 100644 --- a/Oqtane.Upgrade/Program.cs +++ b/Oqtane.Upgrade/Program.cs @@ -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))