Skip to content

Commit

Permalink
update script
Browse files Browse the repository at this point in the history
  • Loading branch information
ota-meshi committed Dec 27, 2020
1 parent e1cabbb commit f934005
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .env-cmdrc
@@ -0,0 +1,5 @@
{
"version": {
"IN_VERSION_SCRIPT": "true"
}
}
5 changes: 3 additions & 2 deletions package.json
Expand Up @@ -14,8 +14,8 @@
"lint": "eslint . --rulesdir eslint-internal-rules",
"lint:fix": "eslint . --rulesdir eslint-internal-rules --fix",
"tsc": "tsc",
"preversion": "npm test && npm run update && git add .",
"version": "npm run lint -- --fix && git add .",
"preversion": "npm test && git add .",
"version": "env-cmd -e version npm run update && npm run lint -- --fix && git add .",
"update": "node ./tools/update.js",
"docs:watch": "vuepress dev docs",
"predocs:build": "npm run update",
Expand Down Expand Up @@ -66,6 +66,7 @@
"@typescript-eslint/parser": "^3.0.2",
"@vuepress/plugin-pwa": "^1.4.1",
"babel-eslint": "^10.1.0",
"env-cmd": "^10.1.0",
"eslint": "^7.0.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-eslint-plugin": "^2.2.1",
Expand Down
8 changes: 2 additions & 6 deletions tools/update-docs.js
Expand Up @@ -67,12 +67,8 @@ function pickSince(content) {
return since[1]
}
}
if (
process.env.npm_package_version &&
process.env.npm_package_version !== require('../package.json').version
) {
// Maybe version script
return `v${process.env.npm_package_version}`
if (process.env.IN_VERSION_SCRIPT) {
return `v${require('../package.json').version}`
}
return null
}
Expand Down

0 comments on commit f934005

Please sign in to comment.