wot-design-uni/docs/build/deploy/check-deploy.js
2023-07-20 00:30:07 +08:00

23 lines
749 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const stopDeploy = (reason) => {
process.stdout.write(reason + '\n')
process.exit(0)
}
/** ******在此区间进行部署条件校验不通过时调用stopDeploy停止部署************************/
// 当前的git tag 版本
const version = process.env.RELEASE_NAME
if (!version) {
stopDeploy('Can\'t find version to deploy, and stop to deploy !')
}
if (version !== `v${require('../../package.json').version}`) {
stopDeploy('The deploy version isn\'t same as package.json')
}
if (!process.env.RELEASE_NOTE) {
stopDeploy('Can\'t find the version\'s release notes of changelog.md')
}
/** ******在此区间进行部署条件校验不通过时调用stopDeploy停止部署************************/
process.stdout.write(true + '\n')