Removed commented code
This commit is contained in:
@@ -119,29 +119,25 @@ public class DirectoryManager : BaseManager
|
|||||||
public int DeleteEmptyDirectories(string? directory, int level)
|
public int DeleteEmptyDirectories(string? directory, int level)
|
||||||
{
|
{
|
||||||
var deleted = 0;
|
var deleted = 0;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
var curDir = directory;
|
var curDir = directory;
|
||||||
for (var i = 0; i < level; i++)
|
for (var i = 0; i < level; i++)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!System.IO.Directory.Exists(curDir))
|
if (!System.IO.Directory.Exists(curDir))
|
||||||
{
|
{
|
||||||
// return deleted;
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.IsDirectoryEmpty(curDir))
|
if (this.IsDirectoryEmpty(curDir))
|
||||||
{
|
{
|
||||||
System.IO.Directory.Delete(curDir);
|
System.IO.Directory.Delete(curDir);
|
||||||
|
deleted++;
|
||||||
}
|
}
|
||||||
|
|
||||||
curDir = System.IO.Directory.GetParent(curDir).ToString();
|
curDir = System.IO.Directory.GetParent(curDir).ToString();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user