Skip to content

Instantly share code, notes, and snippets.

@xlson
Created June 3, 2010 17:07
Show Gist options
  • Save xlson/424155 to your computer and use it in GitHub Desktop.
Save xlson/424155 to your computer and use it in GitHub Desktop.
Create placeholders before checking in a new project to git or your versioning system of choice.
#!/usr/bin/env groovy
assert args.size() == 1 : "Specify the path of the folder that needs placeholders."
def projectFolder = new File(args[0])
projectFolder.eachDirRecurse { dir ->
if(dir.list().size() == 0) {
def placeholder = new File(dir, '.PLACEHOLDER')
println "Creating: $placeholder.absolutePath"
placeholder.createNewFile()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment