Closed michaelsbradleyjr closed 9 years ago
How do you want to achieve that without recursion? I could not imagine a solution without a recursion.
It's possible to convert recursive functions into non-recursive loops, through a technique generally referred to as "trampolining":
http://raganwald.com/2013/03/28/trampolines-in-javascript.html
@michaelsbradleyjr Trampolines are way too complicated for this easy task, just use an array as a stack and fill this up with the directories that need to be cleaned, emptying the stack along the way and everything is fine...
Will provide a PR for this.
See #840(bower).
When there are a large number of directories to clean up, the current implementation seems to result in a "Maximum call stack size exceeded" exception.