This commit is contained in:
2023-10-15 12:15:22 -07:00
parent 37b7ad2a1f
commit d17b051da7
10 changed files with 247 additions and 234 deletions

View File

@ -21,7 +21,7 @@ public class DeleteByRelative
string searchPattern = "*";
long ticks = DateTime.Now.Ticks;
Configuration configuration = Property.Models.Binder.Configuration.Get(isEnvironment, configurationRoot);
logger?.LogInformation(configuration.RootDirectory);
logger?.LogInformation(configuration.RootDirectory);
int length = configuration.RootDirectory.Length;
if (string.IsNullOrEmpty(appSettings.CompareRootDirectory) || Path.GetFullPath(appSettings.CompareRootDirectory) == Path.GetFullPath(configuration.RootDirectory))
throw new Exception("Check AppSettings file!");
@ -59,14 +59,14 @@ public class DeleteByRelative
File.WriteAllLines(deleteLog, deleteFiles);
if (deleteFiles.Count > 0)
{
logger?.LogInformation($"Ready to delete {deleteFiles.Count} file(s)? See <{deleteLog}>");
logger?.LogInformation($"Ready to delete {deleteFiles.Count} file(s)? See <{deleteLog}>");
for (int y = 0; y < int.MaxValue; y++)
{
logger?.LogInformation("Press \"Y\" key to delete file(s) or close console to not delete files");
logger?.LogInformation("Press \"Y\" key to delete file(s) or close console to not delete files");
if (Console.ReadKey().Key == ConsoleKey.Y)
break;
}
logger?.LogInformation(". . .");
logger?.LogInformation(". . .");
foreach (string deleteFile in deleteFiles)
{
File.Delete(deleteFile);