Created
August 25, 2017 23:27
-
-
Save btforsythe/7f5d68eaa94a2fd04828b1b15900c123 to your computer and use it in GitHub Desktop.
Creating src directories with Groovy combinations()
This file contains hidden or 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
def dirElements = [['src'],['main', 'test'],['java', 'resources']].combinations() | |
println "elements are $dirElements" | |
dirElements.each { | |
def dir = new File(it.join(File.separator)) | |
println "checking for $dir" | |
if(!dir.exists()) { | |
dir.mkdirs() | |
println "created $dir" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment