2022-02-09 14:02:38 +00:00
|
|
|
// Ensure that current package version is referenced in the Changelog.md
|
|
|
|
import { readFileSync } from 'fs'
|
|
|
|
|
2022-02-14 16:57:18 +00:00
|
|
|
const packageVersion = JSON.parse(readFileSync('./package.json')).version
|
2022-02-09 14:02:38 +00:00
|
|
|
|
2022-02-14 16:57:18 +00:00
|
|
|
const changelog = readFileSync('./CHANGELOG.md')
|
2022-02-09 14:02:38 +00:00
|
|
|
|
|
|
|
if (!changelog.includes(`## ${packageVersion}\n`)) {
|
|
|
|
throw Error(
|
|
|
|
`Current version ${packageVersion} is not referenced in the CHANGELOG.md`
|
|
|
|
)
|
|
|
|
}
|