Skip to content

Commit

Permalink
React directory name from the path instead of inferring it from the b…
Browse files Browse the repository at this point in the history
…lock name
  • Loading branch information
adamziel committed May 9, 2022
1 parent 25c4254 commit 9193299
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/release/sync-stable-blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const BLOCK_LIBRARY_SRC = 'node_modules/@wordpress/block-library/src/';
* Refreshes the PHP files referring to stable @wordpress/block-library blocks.
*/
function main() {
const blocks = getBlocksJsonPaths().map( readEnrichedMetadata ).filter( isStable );
const blocks = getStableBlocksMetadata();

// wp-includes/blocks/require-blocks.php
console.log( 'Refreshing wp-includes/blocks/require-blocks.php...' );
Expand Down Expand Up @@ -93,8 +93,9 @@ function isDynamic( metadata ) {
* @return {string} Parent directory name.
*/
function toDirectoryName( metadata ) {
const pathSegments = metadata.path.split( "/" );
return (
metadata.name.replace( 'core/', '' )
pathSegments[ pathSegments.length - 2 ]
);
}

Expand Down

0 comments on commit 9193299

Please sign in to comment.