From aebcb0630807874af99f03c0c4032922d061110c Mon Sep 17 00:00:00 2001 From: indy koning Date: Tue, 5 Oct 2021 17:11:11 +0200 Subject: [PATCH] Allow wildcard in patches search folder path --- src/Patch/SourceLoaders/PatchesSearch.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Patch/SourceLoaders/PatchesSearch.php b/src/Patch/SourceLoaders/PatchesSearch.php index 783e25cc..2caf5504 100644 --- a/src/Patch/SourceLoaders/PatchesSearch.php +++ b/src/Patch/SourceLoaders/PatchesSearch.php @@ -102,13 +102,15 @@ public function load(\Composer\Package\PackageInterface $package, $source) $basePath = $this->getInstallPath($package); $results = array(); - foreach ($source as $item) { - $paths = $this->fileSystemUtils->collectFilePathsRecursively( - $basePath . DIRECTORY_SEPARATOR . $item, - sprintf('/%s/i', PluginConfig::PATCH_FILE_REGEX_MATCHER) - ); + foreach ($source as $sourceGlob) { + foreach (glob($sourceGlob) as $item) { + $paths = $this->fileSystemUtils->collectFilePathsRecursively( + $basePath . DIRECTORY_SEPARATOR . $item, + sprintf('/%s/i', PluginConfig::PATCH_FILE_REGEX_MATCHER) + ); - $results[] = $this->createPatchDefinitions($basePath, $paths); + $results[] = $this->createPatchDefinitions($basePath, $paths); + } } return $results;