Permalink
Browse files

fix(publish): add version number validation and rename script (#2117)

  • Loading branch information...
wendzhue authored and vthinkxie committed Sep 17, 2018
1 parent e8dad8f commit bc1f6fad58a4197ec5c2399b0ad2d9febff22668
Showing with 5 additions and 2 deletions.
  1. +1 −1 package.json
  2. +4 −1 publish_scripts/publish.js
@@ -24,7 +24,7 @@
"integration-rollup": "npm run generate && cd integration/rollup && npm run integration",
"lint": "tslint -c tslint.json 'components/*/*.ts'",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s && node site_scripts/replace-scope-prefix.js",
"publish": "node ./publish_scripts/publish.js"
"release": "node ./publish_scripts/publish.js"
},
"main": "./bundles/antd.umd.js",
"module": "./esm5/antd.js",
@@ -50,6 +50,9 @@ function changeVersion() {
let version;
function checkVersionNumber(cur, next) {
// Must be numbers and dots.
if (!/^[1-9][0-9.]{1,10}[0-9]$/.test(next)) { return false; }
const curArr = cur.split('.');
const nextArr = next.split('.');
const length = curArr.length;
@@ -71,7 +74,7 @@ function changeVersion() {
versionNumberValid = true;
nextVersion = version;
} else {
log.error(`The current version ${currentVersion} is not ahead of your input. Please check it.`);
log.error(`Your input ${version} is not after the current version ${currentVersion} or is unvalid. Please check it.`);
}
}

0 comments on commit bc1f6fa

Please sign in to comment.