Csharpier format
This commit is contained in:
@@ -1,26 +1,29 @@
|
||||
|
||||
namespace DotNetSolutionTools.Core;
|
||||
namespace DotNetSolutionTools.Core;
|
||||
|
||||
public static class CleanFolder
|
||||
{
|
||||
public static void DeleteBinObjAndNodeModulesFoldersInFolder(string folderPath)
|
||||
{
|
||||
var nodeModulesFolders = Directory.GetDirectories(folderPath, "*", SearchOption.AllDirectories)
|
||||
var nodeModulesFolders = Directory
|
||||
.GetDirectories(folderPath, "*", SearchOption.AllDirectories)
|
||||
.Where(x => x.EndsWith(Path.DirectorySeparatorChar + "node_modules"))
|
||||
.ToList();
|
||||
|
||||
|
||||
foreach (var folder in nodeModulesFolders)
|
||||
{
|
||||
Directory.Delete(folder, true);
|
||||
}
|
||||
|
||||
var binAndObjFolders = Directory.GetDirectories(folderPath, "*", SearchOption.AllDirectories)
|
||||
.Where(x => x.EndsWith(Path.DirectorySeparatorChar + "bin") || x.EndsWith(Path.DirectorySeparatorChar + "obj"))
|
||||
|
||||
var binAndObjFolders = Directory
|
||||
.GetDirectories(folderPath, "*", SearchOption.AllDirectories)
|
||||
.Where(x =>
|
||||
x.EndsWith(Path.DirectorySeparatorChar + "bin") || x.EndsWith(Path.DirectorySeparatorChar + "obj")
|
||||
)
|
||||
.ToList();
|
||||
|
||||
|
||||
foreach (var folder in binAndObjFolders)
|
||||
{
|
||||
Directory.Delete(folder, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user