Skip to content
This repository was archived by the owner on Nov 18, 2022. It is now read-only.

Implement checking changelog for corresponding version entry #320

Merged
merged 1 commit into from
May 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cmd/check-version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const { version } = require('../package');
const changelog = String(require('fs').readFileSync('CHANGELOG.md')).split('\n');
if (!changelog.find(line => line.startsWith('### ' + version))) {
throw new Error(`The package.json version ${version} does not seem to have a matching heading in CHANGELOG.json`);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CHANGELOG.json -> CHANGELOG.md

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, will fix.

}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@
],
"main": "./out/src/extension",
"scripts": {
"vscode:prepublish": "npm run lint && npm run compile",
"vscode:prepublish": "npm run check:version && npm run lint && npm run compile",
"compile": "tsc -p ./",
"watch": "tsc -watch -p ./",
"lint": "tslint --config ./tslint.json './src/**/*.ts'",
"check:version": "node cmd/check-version.js",
"postinstall": "node ./node_modules/vscode/bin/install"
},
"dependencies": {
Expand Down