代码拉取完成,页面将自动刷新
const ora = require('ora')
const shell = require('shelljs')
function exec(script = '') {
return new Promise((resolve, reject) =>
shell
.exec(script, { async: true })
.on('close', code => (code === 0 ? resolve() : reject(code)))
)
}
;(async function () {
const spinner = ora()
try {
const version = process.argv[2]
if (typeof version !== 'string' || !version.trim()) {
throw new Error()
}
await exec('npm run lint')
await exec(`npm --no-git-tag-version version ${version.trim()}`)
await exec('git add .')
await exec('git commit -m "chore(all): 更新npm版本号"')
await exec('conventional-changelog -p angular -i CHANGELOG.md -s -r 0')
await exec('npm run lint')
await exec('git add .')
await exec('git commit -m "docs(all): 更新changelog"')
await exec(`git tag v${version.trim()}`)
await exec('git push origin --tags')
await exec('git push origin master')
spinner.succeed('创建版本号成功!')
} catch (error) {
spinner.fail('创建版本号失败!')
}
})()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。