[DATFromDir] Clean-as-you-go directories

This commit is contained in:
Matt Nadareski
2016-09-22 14:50:06 -07:00
parent 9c57b1f68d
commit 6b43053b7d

View File

@@ -273,12 +273,6 @@ namespace SabreTools
// If the file was an archive and was extracted successfully, check it
if (!encounteredErrors)
{
// Cue to delete the file if it's a copy
if (_copyFiles && item != newItem)
{
FileTools.CleanDirectory(Path.GetDirectoryName(Path.GetFullPath(newItem)));
}
_logger.Log(Path.GetFileName(item) + " treated like an archive");
List<string> extracted = Directory.EnumerateFiles(tempSubDir, "*", SearchOption.AllDirectories).ToList();
Parallel.ForEach(extracted,
@@ -303,7 +297,7 @@ namespace SabreTools
// Cue to delete the file if it's a copy
if (_copyFiles && item != newItem)
{
FileTools.CleanDirectory(Path.GetDirectoryName(Path.GetFullPath(newItem)));
Directory.Delete(Path.GetDirectoryName(Path.GetFullPath(newItem)), true);
}
// Delete the sub temp directory