chore(changelog): fix changelog script
There was an issue with the "unreleased" link tag, which had been converted to lowercase by Prettier.
This commit is contained in:
@@ -199,7 +199,7 @@ First release
|
|||||||
|
|
||||||
#
|
#
|
||||||
|
|
||||||
[unreleased]: https://github.com/EndBug/add-and-commit/compare/v5.3.0...HEAD
|
[unreleased]: https://github.com/EndBug/add-and-commit/compare/v6.1.0...HEAD
|
||||||
[1.0.0]: https://github.com/EndBug/add-and-commit/tree/v1.0.0
|
[1.0.0]: https://github.com/EndBug/add-and-commit/tree/v1.0.0
|
||||||
[2.0.0]: https://github.com/EndBug/add-and-commit/compare/v1.0.0...v2.0.0
|
[2.0.0]: https://github.com/EndBug/add-and-commit/compare/v1.0.0...v2.0.0
|
||||||
[2.1.0]: https://github.com/EndBug/add-and-commit/compare/v2.0.0...v2.1.0
|
[2.1.0]: https://github.com/EndBug/add-and-commit/compare/v2.0.0...v2.1.0
|
||||||
|
|||||||
@@ -27,13 +27,11 @@ arr[1] =
|
|||||||
futureChangelog = arr.join('## [Unreleased]')
|
futureChangelog = arr.join('## [Unreleased]')
|
||||||
|
|
||||||
// Update footer
|
// Update footer
|
||||||
arr = futureChangelog
|
arr = futureChangelog.split('\n').map((line) =>
|
||||||
.split('\n')
|
line.startsWith('[unreleased]') // The link ref is lowercase because of prettier
|
||||||
.map((line) =>
|
? `[unreleased]: https://github.com/EndBug/add-and-commit/compare/v${currentVersion}...HEAD`
|
||||||
line.startsWith('[Unreleased]')
|
: line
|
||||||
? `[Unreleased]: https://github.com/EndBug/add-and-commit/compare/v${currentVersion}...HEAD`
|
)
|
||||||
: line
|
|
||||||
)
|
|
||||||
|
|
||||||
const lastVersion = ([...arr].reverse()[1]?.match(/\[([^\][]*)]/) ||
|
const lastVersion = ([...arr].reverse()[1]?.match(/\[([^\][]*)]/) ||
|
||||||
[])[0].replace(/[\[\]']+/g, '') // eslint-disable-line no-useless-escape
|
[])[0].replace(/[\[\]']+/g, '') // eslint-disable-line no-useless-escape
|
||||||
|
|||||||
Reference in New Issue
Block a user