Skip to content

Commit

Permalink
docgen: Move packageName assignment outside loop
Browse files Browse the repository at this point in the history
Co-Authored-By: Andrés <nosolosw@users.noreply.github.com>
  • Loading branch information
aduth and nosolosw committed Dec 4, 2019
1 parent 4190816 commit 3958615
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bin/update-readmes.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,13 @@ glob.stream( `${ PACKAGES_DIR }/${ getPackagePattern( files ) }/README.md` )
.on( 'data', async ( /** @type {WPReadmeFileData} */ data ) => {
const [ file, tokens ] = data;

const packageName = getFilePackage( file );

// Each file can have more than one placeholder content to update, each
// represented by tokens. The docgen script updates one token at a time,
// so the tokens must be replaced in sequence to prevent the processes
// from overriding each other.
for ( const [ token, path ] of tokens ) {
const packageName = getFilePackage( file );
try {
await execa(
join( __dirname, '..', 'node_modules', '.bin', 'docgen' ),
Expand Down

0 comments on commit 3958615

Please sign in to comment.