From 36ca33077f74c74c11dc747d33e345a165a904ee Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 19 Mar 2019 13:34:40 +0000 Subject: [PATCH] Add filtered publishing --- publish/do.groovy | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/publish/do.groovy b/publish/do.groovy index 2d5ee05..732373e 100644 --- a/publish/do.groovy +++ b/publish/do.groovy @@ -104,9 +104,14 @@ def copydirectory(File dirFrom, File dirTo) { def filteredpublish(itempathstopublish, customer) { for (String itempath : itempathstopublish) { - // Convert glob wildcard paths to real paths - echo "Finding files at base folder: ${releaserepofolder} and glob filter: ${itempath}" - def srcpaths = new FileNameFinder().getFileNames(releaserepofolder, itempath) + def defaultsrcpath = "${releaserepofolder}/${itempath}" + def srcpaths = [ defaultsrcpath ] + if (itempath.endsWith('**') { // Convert glob wildcard paths to real paths + File srcfilepath = new File(defaultsrcpath).getParentFile() + def globpattern = '**' + echo "Finding files at base folder: ${srcfilepath} and glob filter: ${globpattern}" + srcpaths = new FileNameFinder().getFileNames(releaserepofolder, globpattern) + } echo "Paths found: ${srcpaths}" for (String srcpath: srcpaths) { def File srcpathfile = new File(srcpath)