Merge pull request #2299 from chlupac/InstallManFix
Fix - InstallationManager crash when package folders are missing
This commit is contained in:
commit
ded6c9c199
@ -48,15 +48,19 @@ namespace Oqtane.Infrastructure
|
||||
}
|
||||
|
||||
// move packages to secure /Packages folder
|
||||
foreach (var folder in "Modules,Themes,Packages".Split(","))
|
||||
foreach (var folderName in "Modules,Themes,Packages".Split(","))
|
||||
{
|
||||
foreach(var file in Directory.GetFiles(Path.Combine(webRootPath, folder), "*.nupkg*"))
|
||||
string folder = Path.Combine(webRootPath, folderName);
|
||||
if (Directory.Exists(folder))
|
||||
{
|
||||
foreach (var file in Directory.GetFiles(folder, "*.nupkg*"))
|
||||
{
|
||||
var destinationFile = Path.Combine(sourceFolder, Path.GetFileName(file));
|
||||
if (File.Exists(destinationFile))
|
||||
{
|
||||
File.Delete(destinationFile);
|
||||
}
|
||||
|
||||
if (destinationFile.ToLower().EndsWith(".nupkg.bak"))
|
||||
{
|
||||
// leave a copy in the current folder as it is distributed with the core framework
|
||||
@ -69,6 +73,11 @@ namespace Oqtane.Infrastructure
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Directory.CreateDirectory(folder);
|
||||
}
|
||||
}
|
||||
|
||||
// iterate through Nuget packages in source folder
|
||||
foreach (string packagename in Directory.GetFiles(sourceFolder, "*.nupkg"))
|
||||
|
Loading…
x
Reference in New Issue
Block a user