Skip to content

Commit 05b28a3

Browse files
committed
fix: copy block.json during when deploying using zip archive
1 parent 10f3aec commit 05b28a3

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/Build/CompressBuildFilesStep.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ public function perform(string $environment, ProjectConfiguration $projectConfig
7070
$environment = $projectConfiguration->getEnvironment($environment);
7171
$files = Finder::create()
7272
->append($this->getRequiredFiles())
73+
->append($this->getRequiredPluginFiles())
7374
->append($this->getRequiredThemeFiles())
7475
->append($this->getRequiredFileTypes())
7576
->append($this->getWordPressCoreFiles($projectConfiguration->getProjectType()));
@@ -148,6 +149,17 @@ private function getRequiredFileTypes(): Finder
148149
->name(['*.mo', '*.php']);
149150
}
150151

152+
/**
153+
* Get the Finder object for finding all the required plugin files.
154+
*/
155+
private function getRequiredPluginFiles(): Finder
156+
{
157+
return $this->getBaseFinder()
158+
->path([
159+
'/plugins\/[^\/]*\/block\.json$/',
160+
]);
161+
}
162+
151163
/**
152164
* Get the Finder object for finding all the required theme files.
153165
*/
@@ -157,6 +169,7 @@ private function getRequiredThemeFiles(): Finder
157169
->path([
158170
'/themes\/[^\/]*\/screenshot\.(gif|jpe?g|png)$/',
159171
'/themes\/[^\/]*\/style\.css$/',
172+
'/themes\/[^\/]*\/block\.json$/',
160173
'/themes\/[^\/]*\/theme\.json$/',
161174
'/themes\/[^\/]*\/[^\/]*\/.*\.html/',
162175
'/themes\/[^\/]*\/[^\/]*\/.*\.json$/',

0 commit comments

Comments
 (0)