mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[DATFromDir] Clean-as-you-go directories
This commit is contained in:
@@ -273,12 +273,6 @@ namespace SabreTools
|
|||||||
// If the file was an archive and was extracted successfully, check it
|
// If the file was an archive and was extracted successfully, check it
|
||||||
if (!encounteredErrors)
|
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");
|
_logger.Log(Path.GetFileName(item) + " treated like an archive");
|
||||||
List<string> extracted = Directory.EnumerateFiles(tempSubDir, "*", SearchOption.AllDirectories).ToList();
|
List<string> extracted = Directory.EnumerateFiles(tempSubDir, "*", SearchOption.AllDirectories).ToList();
|
||||||
Parallel.ForEach(extracted,
|
Parallel.ForEach(extracted,
|
||||||
@@ -303,7 +297,7 @@ namespace SabreTools
|
|||||||
// Cue to delete the file if it's a copy
|
// Cue to delete the file if it's a copy
|
||||||
if (_copyFiles && item != newItem)
|
if (_copyFiles && item != newItem)
|
||||||
{
|
{
|
||||||
FileTools.CleanDirectory(Path.GetDirectoryName(Path.GetFullPath(newItem)));
|
Directory.Delete(Path.GetDirectoryName(Path.GetFullPath(newItem)), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete the sub temp directory
|
// Delete the sub temp directory
|
||||||
|
|||||||
Reference in New Issue
Block a user