-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #994 from Codeinwp/chore/readme-release-notes
refactor: keep only the latest release in `readme.txt`
- Loading branch information
Showing
3 changed files
with
23 additions
and
1,075 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const replace = require('replace-in-file'); | ||
|
||
async function updateChangelog() { | ||
const options = { | ||
files: 'readme.txt', | ||
from: /== Changelog ==[\s\S]*?\[See changelog for all versions\]/, | ||
to: (match) => { | ||
return `== Changelog ==\n\n${process.env.nextReleaseNotes}\n\n[See changelog for all versions]`; | ||
}, | ||
encoding: 'utf8', | ||
}; | ||
try { | ||
const results = await replace(options); | ||
console.log('Replacement results:', results); | ||
} catch (error) { | ||
console.error('Error occurred:', error); | ||
} | ||
} | ||
|
||
updateChangelog(); |
Oops, something went wrong.