Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jeffscottbrown/51a0ab45e926f376a77aef95d19d46ae to your computer and use it in GitHub Desktop.
Save jeffscottbrown/51a0ab45e926f376a77aef95d19d46ae to your computer and use it in GitHub Desktop.
~ $ pwd
/Users/jeffscottbrown
~ $
~ $ ls stevemayster
~ $
~ $ cat stevewantstocreatedirectory.groovy
def nametest = 'try'
def patchPath = '/Users/jeffscottbrown/stevemayster'
def fileName = "${patchPath}/${nametest}"
def file = new File(fileName)
if(!file.exists()) {
// you can check the return value
// of this call to know if it succeeded
// if you like...
file.mkdir()
}
~ $
~ $ groovy stevewantstocreatedirectory.groovy
~ $
~ $
~ $ ls stevemayster
try
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment