Created
April 14, 2022 14:16
-
-
Save jeffscottbrown/51a0ab45e926f376a77aef95d19d46ae to your computer and use it in GitHub Desktop.
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
~ $ 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