Delete-By-Relative UserSecretsId
This commit is contained in:
@ -59,24 +59,27 @@ public class DeleteByRelative
|
||||
throw new NullReferenceException(nameof(alongSideDirectory));
|
||||
string deleteLog = Path.Combine(alongSideDirectory, $"{directoryName}-{ticks}.tsv");
|
||||
File.WriteAllLines(deleteLog, deleteFiles);
|
||||
log.Information($"Ready to delete {deleteFiles.Count} file(s)? See <{deleteLog}>");
|
||||
for (int y = 0; y < int.MaxValue; y++)
|
||||
if (deleteFiles.Any())
|
||||
{
|
||||
log.Information("Press \"Y\" key to delete file(s) or close console to not delete files");
|
||||
if (Console.ReadKey().Key == ConsoleKey.Y)
|
||||
break;
|
||||
log.Information($"Ready to delete {deleteFiles.Count} file(s)? See <{deleteLog}>");
|
||||
for (int y = 0; y < int.MaxValue; y++)
|
||||
{
|
||||
log.Information("Press \"Y\" key to delete file(s) or close console to not delete files");
|
||||
if (Console.ReadKey().Key == ConsoleKey.Y)
|
||||
break;
|
||||
}
|
||||
log.Information(". . .");
|
||||
foreach (string deleteFile in deleteFiles)
|
||||
{
|
||||
File.Delete(deleteFile);
|
||||
checkFileName = $"{deleteFile}.id";
|
||||
if (!File.Exists(checkFileName))
|
||||
continue;
|
||||
File.Delete(checkFileName);
|
||||
}
|
||||
for (int i = 1; i < 5; i++)
|
||||
_ = Shared.Models.Stateless.Methods.IPath.DeleteEmptyDirectories(appSettings.CompareRootDirectory);
|
||||
}
|
||||
log.Information(". . .");
|
||||
foreach (string deleteFile in deleteFiles)
|
||||
{
|
||||
File.Delete(deleteFile);
|
||||
checkFileName = $"{deleteFile}.id";
|
||||
if (!File.Exists(checkFileName))
|
||||
continue;
|
||||
File.Delete(checkFileName);
|
||||
}
|
||||
for (int i = 1; i < 5; i++)
|
||||
_ = Shared.Models.Stateless.Methods.IPath.DeleteEmptyDirectories(appSettings.CompareRootDirectory);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user