How to remove empty folders or delete directories in a tree using Angular Schematics?

Viewed 106

I am trying to delete a folder with files using Tree.delete. Unfortunately there's an error if you're trying to delete a directory. So, I created a function that recursively removes the files using Tree.getDir and the underlying APIs. In the end, I successfully deleted all the files, but not the empty folders. Is there a way to do this in Angular Schematics (using Angular v11.x.x)?

Thanks in advance!

0 Answers
Related