Skip to content

Commit 11d61e3

Browse files
authored
Merge pull request rust-lang#320 from TomasHubelbauer/292
Implement checking changelog for corresponding version entry
2 parents 8fedb00 + 00b40b0 commit 11d61e3

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

cmd/check-version.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const { version } = require('../package');
2+
const changelog = String(require('fs').readFileSync('CHANGELOG.md')).split('\n');
3+
if (!changelog.find(line => line.startsWith('### ' + version))) {
4+
throw new Error(`The package.json version ${version} does not seem to have a matching heading in CHANGELOG.json`);
5+
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,11 @@
3939
],
4040
"main": "./out/src/extension",
4141
"scripts": {
42-
"vscode:prepublish": "npm run lint && npm run compile",
42+
"vscode:prepublish": "npm run check:version && npm run lint && npm run compile",
4343
"compile": "tsc -p ./",
4444
"watch": "tsc -watch -p ./",
4545
"lint": "tslint --config ./tslint.json './src/**/*.ts'",
46+
"check:version": "node cmd/check-version.js",
4647
"postinstall": "node ./node_modules/vscode/bin/install"
4748
},
4849
"dependencies": {

0 commit comments

Comments
 (0)