Created
May 2, 2013 13:48
-
-
Save matthewadams/5502305 to your computer and use it in GitHub Desktop.
Closure to remove an entire directory tree.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rmdirs = { | |
it = (it instanceof File) ? it : new File(it) | |
if (!it.exists()) return | |
it.eachDir(delDir) | |
it.eachFile { it.delete() } | |
it.delete() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment