Merge "Create dir/file using shell commands"
diff --git a/src/com/mirantis/mk/ReleaseWorkflow.groovy b/src/com/mirantis/mk/ReleaseWorkflow.groovy
index 3316c68..adb49a6 100644
--- a/src/com/mirantis/mk/ReleaseWorkflow.groovy
+++ b/src/com/mirantis/mk/ReleaseWorkflow.groovy
@@ -141,16 +141,10 @@
def keySize = key.split(':').size() - 1
if (dirdepth > 0 && dirdepth - 1 <= keySize) {
def dirPath = metadataDir + '/' + key.split(':')[0..dirdepth - 1].join('/')
- if (!new File(dirPath).exists()) {
- File newDirs = new File(dirPath)
- newDirs.mkdirs()
- }
+ sh "if ! test -d \"${dirPath}\" ; then mkdir -p \"${dirPath}\"; fi"
if (dirdepth - 1 != keySize) {
def pathToDummyFile = dirPath + '/' + key.split(':')[dirdepth] + '.yml'
- if (!new File(pathToDummyFile).exists()) {
- File dummyFile = new File(pathToDummyFile)
- dummyFile.write ''
- }
+ sh "if ! test -f \"${pathToDummyFile}\" ; then touch \"${pathToDummyFile}\"; fi"
}
}