Skip to content

Commit

Permalink
Merge pull request #778 from WordPress/fix/since-command-whitespace
Browse files Browse the repository at this point in the history
Fix whitespace not matching in `since` command.
  • Loading branch information
joemcgill authored Jul 14, 2023
2 parents 8e9250b + 6287a8c commit e7b5750
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bin/plugin/commands/since.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,14 @@ exports.handler = async ( opt ) => {
ignore: [ __filename, '**/node_modules', '**/vendor' ],
} );

const regexp = new RegExp( '@since n.e.x.t', 'g' );
const regexp = new RegExp( '@since(\\s+)n.e.x.t', 'g' );

files.forEach( ( file ) => {
const content = fs.readFileSync( file, 'utf-8' );
if ( regexp.test( content ) ) {
fs.writeFileSync(
file,
content.replace( regexp, `@since ${ opt.release }` )
content.replace( regexp, `@since$1${ opt.release }` )
);
}
} );
Expand Down

0 comments on commit e7b5750

Please sign in to comment.