Ai
1 Star 0 Fork 451

咸鱼郑某/element-plus

forked from element-plus/element-plus 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
update-version.ts 1.47 KB
一键复制 编辑 原始数据 按行查看 历史
三咲智子 提交于 2022-05-06 20:02 +08:00 . fix(ci): publish nightly (#7537)
import consola from 'consola'
import chalk from 'chalk'
import { errorAndExit, getWorkspacePackages } from '@element-plus/build-utils'
import type { Project } from '@pnpm/find-workspace-packages'
async function main() {
const tagVersion = process.env.TAG_VERSION
const gitHead = process.env.GIT_HEAD
if (!tagVersion || !gitHead) {
errorAndExit(
new Error(
'No tag version or git head were found, make sure that you set the environment variable $TAG_VERSION \n'
)
)
}
consola.log(chalk.cyan('Start updating version'))
consola.log(chalk.cyan(`$TAG_VERSION: ${tagVersion}`))
consola.log(chalk.cyan(`$GIT_HEAD: ${gitHead}`))
consola.debug(chalk.yellow(`Updating package.json for element-plus`))
const pkgs = Object.fromEntries(
(await getWorkspacePackages()).map((pkg) => [pkg.manifest.name!, pkg])
)
const elementPlus = pkgs['element-plus'] || pkgs['@element-plus/nightly']
const eslintConfig = pkgs['@element-plus/eslint-config']
const metadata = pkgs['@element-plus/metadata']
const writeVersion = async (project: Project) => {
await project.writeProjectManifest({
...project.manifest,
version: tagVersion,
gitHead,
} as any)
}
try {
await writeVersion(elementPlus)
await writeVersion(eslintConfig)
await writeVersion(metadata)
} catch (err) {
errorAndExit(err)
}
consola.debug(chalk.green(`$GIT_HEAD: ${gitHead}`))
consola.success(chalk.green(`Git head updated to ${gitHead}`))
}
main()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/ZHFHZ/element-plus.git
git@gitee.com:ZHFHZ/element-plus.git
ZHFHZ
element-plus
element-plus
dev

搜索帮助