diff --git a/publish/do.groovy b/publish/do.groovy index c3d229e..eea1015 100644 --- a/publish/do.groovy +++ b/publish/do.groovy @@ -88,7 +88,7 @@ def publish(String customer, String finalreleaserepofolder = releaserepofolder) def copydirectory(File dirFrom, File dirTo) { if (!dirTo.exists()) { - dirTo.mkdir(); + dirTo.mkdirs(); } dirFrom.eachFile(FILES) { File source -> File target = new File(dirTo, source.getName()) @@ -103,12 +103,12 @@ def copydirectory(File dirFrom, File dirTo) { def filteredpublish(itempathstopublish, customer) { for (String itempath : itempathstopublish) { def srcpath = "${releaserepofolder}/${itempath}" - File srcpathfile = new File(srcpath) + def File srcpathfile = new File(srcpath) def dstpath = "${filteredreleaserepofolder}/${itempath}" - File dstpathfile = new File(dstpath) - def dstpathdirname = dstpathfile.getParent() - echo "Copying recursively from ${srcpath} to ${dstpath}" - copydirectory(srcpathfile, dstpathfile) + def File dstpathfile = new File(dstpath) + def dstpathparentdir = dstpathfile.getParentFile() + echo "Copying recursively from ${srcpath} to ${dstpathparentdir.getName()}" + copydirectory(srcpathfile, dstpathparentdir) } publish(customer, filteredreleaserepofolder) }