Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

Commit 5492531

Browse files
Merge branch 'add-release-note-changes'
2 parents 6387d0b + 9ceabb0 commit 5492531

File tree

2 files changed

+31
-3
lines changed

2 files changed

+31
-3
lines changed

docs/release-notes-template.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
:tada: **Thanks for downloading Patchwork!** Check out [the changelog](https://github.com/ssbc/patchwork/blob/master/docs/CHANGELOG.md) to see what's new.
1+
:tada: **Thanks for downloading Patchwork!** :tada:
22

33
## Install
44

55
- **Windows:** [`ssb-patchwork-setup-$$VERSION.exe`][exe]
66
- **macOS:** [`Patchwork-$$VERSION.dmg`][dmg] (you may need to [allow apps from "unidentified" developers](https://support.apple.com/kb/PH25088))
77
- **Linux:** [`ssb-patchwork-$$VERSION-x86_64.AppImage`][appimage] (you will need to [make it executable](https://docs.appimage.org/user-guide/run-appimages.html))
88

9-
109
## Getting started
1110

1211
If this is your first time on Scuttlebutt you may need an invite to get connected. After installing Patchwork and choosing your name you should select the **Join Pub** button. You'll need to [get a pub invite](https://github.com/ssbc/ssb-server/wiki/Pub-Servers#public-pubs), paste it into the prompt, and select **Redeem invite**.
1312

1413
You can find more information in the [Getting Started Guide](https://www.scuttlebutt.nz/getting-started).
1514

15+
## Changes
16+
$$CHANGES
1617
## Support
1718
1819
:thinking: [Any questions? Check out the Scuttlebutt FAQ!](https://www.scuttlebutt.nz/faq/)

scripts/release-notes.js

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,33 @@ if (version == null) {
88
}
99

1010
const template = fs.readFileSync(path.join(__dirname, '..', 'docs', 'release-notes-template.md'), 'utf8')
11+
const changelog = fs.readFileSync(path.join(__dirname, '..', 'docs', 'CHANGELOG.md'), 'utf8')
12+
13+
let record = false
14+
const lines = changelog.split('\n')
15+
16+
const relevantLines = lines.reduce((acc, cur) => {
17+
if (cur.startsWith('## ')) {
18+
if (cur.startsWith(`## v${version}`)) {
19+
record = true
20+
return acc
21+
} else {
22+
record = false
23+
return acc
24+
}
25+
}
26+
27+
if (record) {
28+
acc.push(cur)
29+
}
30+
31+
return acc
32+
}, [])
33+
34+
const changes = relevantLines.join('\n')
35+
36+
const releaseNotes = template
37+
.replace(/\$\$VERSION/g, version)
38+
.replace(/\$\$CHANGES/g, changes)
1139

12-
const releaseNotes = template.replace(/\$\$VERSION/g, version)
1340
console.log(releaseNotes)

0 commit comments

Comments
 (0)