Skip to content

Commit

Permalink
Merge branch 'trunk' into fix/add_cover_annotation_test
Browse files Browse the repository at this point in the history
  • Loading branch information
Sarthak Jaiswal authored and Sarthak Jaiswal committed Oct 10, 2024
2 parents 9be9594 + 94fc5e7 commit 6a0b6a3
Show file tree
Hide file tree
Showing 74 changed files with 4,061 additions and 1,521 deletions.
32 changes: 20 additions & 12 deletions bin/plugin/commands/since.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,21 +77,29 @@ exports.handler = async ( opt ) => {
ignore,
} );

const regexp = /(@since\s+)n\.e\.x\.t/g;
const regexps = [
/(@since\s+)n\.e\.x\.t/g,
/('[^']*?)n\.e\.x\.t(?=')/g,
];

let replacementCount = 0;
files.forEach( ( file ) => {
const content = fs.readFileSync( file, 'utf-8' );
if ( regexp.test( content ) ) {
fs.writeFileSync(
file,
content.replace( regexp, function ( matches, sinceTag ) {
replacementCount++;
return sinceTag + version;
} )
);
for ( const file of files ) {
for ( const regexp of regexps ) {
const content = fs.readFileSync( file, 'utf-8' );
if ( regexp.test( content ) ) {
fs.writeFileSync(
file,
content.replace(
regexp,
function ( matches, sinceTag ) {
replacementCount++;
return sinceTag + version;
}
)
);
}
}
} );
}

const commonMessage = `Using version ${ version } for ${ pluginSlug }: `;
if ( replacementCount > 0 ) {
Expand Down
2 changes: 1 addition & 1 deletion bin/test-php-watch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ fi

while true; do
echo "Waiting for a change in the plugins directory..."
output=$(inotifywait -e modify,create,delete -r ./plugins 2> /dev/null)
output=$(inotifywait -e modify,create,delete -r ./plugins --include '.*(\.php$|/tests/.*)' 2> /dev/null)
plugin_slug=$(echo "$output" | awk -F/ '{print $3}')
sleep 1 # Give the user a chance to copy text from terminal before IDE auto-saves.
clear
Expand Down
82 changes: 43 additions & 39 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6a0b6a3

Please sign in to comment.