Fix new AddToArchive methods

This commit is contained in:
Matt Nadareski
2024-08-23 16:23:45 -04:00
parent 3f12c6acb9
commit 22fdd036eb
2 changed files with 4 additions and 3 deletions

View File

@@ -45,6 +45,7 @@
- Fix up some file path methods
- Fix broken build
- Rearrange some BaseProcessor methods
- Fix new AddToArchive methods
### 3.2.1 (2024-08-05)

View File

@@ -259,7 +259,7 @@ namespace MPF.Processors
/// <param name="outputDirectory">Directory that the existing files live in</param>
/// <param name="delete">Indicates if the files should be deleted after adding</param>
/// <returns>True if all files were added successfully, false otherwise</returns>
private bool AddToArchive(ZipArchive archive, List<string> files, string? outputDirectory, bool delete)
private static bool AddToArchive(ZipArchive archive, List<string> files, string? outputDirectory, bool delete)
{
// An empty list means success
if (files.Count == 0)
@@ -267,7 +267,7 @@ namespace MPF.Processors
// Loop through and add all files
bool allAdded = true;
for (string file in files)
foreach (string file in files)
{
allAdded &= AddToArchive(archive, files, outputDirectory, delete);
}
@@ -283,7 +283,7 @@ namespace MPF.Processors
/// <param name="outputDirectory">Directory that the existing file lives in</param>
/// <param name="delete">Indicates if the file should be deleted after adding</param>
/// <returns>True if the file was added successfully, false otherwise</returns>
private bool AddToArchive(ZipArchive archive, string file, string? outputDirectory, bool delete)
private static bool AddToArchive(ZipArchive archive, string file, string? outputDirectory, bool delete)
{
// Check if the file exists
if (!File.Exists(file))