Removed gpcl6win64 and LincPDFC just from proj file Removed package.json to clean out publish directory
28 lines
1.0 KiB
C#
28 lines
1.0 KiB
C#
using File_Watcher.Models;
|
|
|
|
namespace File_Watcher.Helpers;
|
|
|
|
internal static partial class HelperEAFLog
|
|
{
|
|
|
|
internal static bool DeleteFiles(AppSettings appSettings, ILogger<Worker> logger)
|
|
{
|
|
string[] files = Directory.GetFiles(appSettings.FileWatcherConfiguration.WatchDirectory, appSettings.EAFLogConfiguration.SearchPattern, SearchOption.AllDirectories);
|
|
logger.LogInformation("After {MillisecondsDelay} with search pattern '{SearchPattern}' found {files}", appSettings.FileWatcherConfiguration.MillisecondsDelay, appSettings.EAFLogConfiguration.SearchPattern, files.Length);
|
|
foreach (string file in files)
|
|
{
|
|
if (file.EndsWith(".dll"))
|
|
continue;
|
|
if (file.EndsWith(".pdb"))
|
|
continue;
|
|
if (file.EndsWith(".xml"))
|
|
continue;
|
|
try
|
|
{ File.Delete(file); }
|
|
catch (Exception ex)
|
|
{ logger.LogInformation(ex, "Inner loop error!"); }
|
|
}
|
|
return true;
|
|
}
|
|
|
|
} |