Skip to content

Commit 0f7790d

Browse files
committed
fix: filter only existing directories before passing them to finder
1 parent cb1bac7 commit 0f7790d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/Build/EnsurePluginIsInstalledStep.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,12 @@ public function getDescription(): string
4747
*/
4848
public function perform(string $environment, ProjectConfiguration $projectConfiguration)
4949
{
50-
$pluginsPaths = array_map(function (string $path) {
51-
return $this->buildDirectory.$path;
52-
}, 'bedrock' !== $projectConfiguration->getProjectType() ? ['/wp-content/mu-plugins', '/wp-content/plugins'] : ['/web/app/plugins', '/web/app/mu-plugins']);
50+
$pluginsPaths = collect('bedrock' !== $projectConfiguration->getProjectType() ? ['/wp-content/mu-plugins', '/wp-content/plugins'] : ['/web/app/plugins', '/web/app/mu-plugins'])
51+
->map(function (string $relativePath) {
52+
return $this->buildDirectory.$relativePath;
53+
})->filter(function (string $path) {
54+
return is_dir($path);
55+
})->all();
5356

5457
$finder = Finder::create()
5558
->files()

0 commit comments

Comments
 (0)