File tree Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Original file line number Diff line number Diff line change 1+ {
2+ "version": {
3+ "IN_VERSION_SCRIPT": "true"
4+ }
5+ }
Original file line number Diff line number Diff line change 1414 "lint" : " eslint . --rulesdir eslint-internal-rules" ,
1515 "lint:fix" : " eslint . --rulesdir eslint-internal-rules --fix" ,
1616 "tsc" : " tsc" ,
17- "preversion" : " npm test && npm run update && git add ." ,
18- "version" : " npm run lint -- --fix && git add ." ,
17+ "preversion" : " npm test && git add ." ,
18+ "version" : " env-cmd -e version npm run update && npm run lint -- --fix && git add ." ,
1919 "update" : " node ./tools/update.js" ,
2020 "docs:watch" : " vuepress dev docs" ,
2121 "predocs:build" : " npm run update" ,
6666 "@typescript-eslint/parser" : " ^3.0.2" ,
6767 "@vuepress/plugin-pwa" : " ^1.4.1" ,
6868 "babel-eslint" : " ^10.1.0" ,
69+ "env-cmd" : " ^10.1.0" ,
6970 "eslint" : " ^7.0.0" ,
7071 "eslint-config-prettier" : " ^6.11.0" ,
7172 "eslint-plugin-eslint-plugin" : " ^2.2.1" ,
Original file line number Diff line number Diff line change @@ -67,12 +67,8 @@ function pickSince(content) {
6767 return since [ 1 ]
6868 }
6969 }
70- if (
71- process . env . npm_package_version &&
72- process . env . npm_package_version !== require ( '../package.json' ) . version
73- ) {
74- // Maybe version script
75- return `v${ process . env . npm_package_version } `
70+ if ( process . env . IN_VERSION_SCRIPT ) {
71+ return `v${ require ( '../package.json' ) . version } `
7672 }
7773 return null
7874}
You can’t perform that action at this time.
0 commit comments