|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
673 bytes
|
| Rev | Line | |
|---|
| [9af201e] | 1 | // Given a version, figure out what the release notes are so that we can use this to pre-fill the
|
|---|
| 2 | // relase notes on a GitHub release for the current version.
|
|---|
| 3 |
|
|---|
| 4 | let path = require('path')
|
|---|
| 5 | let fs = require('fs')
|
|---|
| 6 |
|
|---|
| 7 | let version =
|
|---|
| 8 | process.argv[2] || process.env.npm_package_version || require('../package.json').version
|
|---|
| 9 |
|
|---|
| 10 | let changelog = fs.readFileSync(path.resolve(__dirname, '..', 'CHANGELOG.md'), 'utf8')
|
|---|
| 11 | let match = new RegExp(
|
|---|
| 12 | `## \\[${version}\\] - (.*)\\n\\n([\\s\\S]*?)\\n(?:(?:##\\s)|(?:\\[))`,
|
|---|
| 13 | 'g'
|
|---|
| 14 | ).exec(changelog)
|
|---|
| 15 |
|
|---|
| 16 | if (match) {
|
|---|
| 17 | let [, , notes] = match
|
|---|
| 18 | console.log(notes.trim())
|
|---|
| 19 | } else {
|
|---|
| 20 | console.log(`Placeholder release notes for version: v${version}`)
|
|---|
| 21 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.