Skip to content

Commit 5f73af8

Browse files
authored
Release Script: Replace @since versions (#1221)
* Update regex * Release Script: Replace @SInCE versions Also fixes migration regex * Revert test changes
1 parent 3a9c3c2 commit 5f73af8

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

bin/release.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,22 @@ async function createRelease(version) {
9999

100100
updateVersionInFile('includes/class-migration.php', version, [
101101
{
102-
search: /version_compare\([^,]+,\s*['"]unreleased['"]/gi,
102+
search: /(?<!\*[\s\S]{0,50})(?<=version_compare\s*\(\s*\$version_from_db,\s*')unreleased(?=',\s*['<=>])/g,
103103
replace: (match) => match.replace(/unreleased/i, version)
104104
}
105105
]);
106106

107+
const phpFiles = execWithOutput('find . -name "*.php"').split('\n');
108+
109+
phpFiles.forEach((filePath) => {
110+
updateVersionInFile(filePath, version, [
111+
{
112+
search: /@since unreleased/g,
113+
replace: `@since ${version}`
114+
}
115+
]);
116+
});
117+
107118
// Update CHANGELOG.md
108119
updateChangelog(version);
109120

0 commit comments

Comments
 (0)