代码拉取完成,页面将自动刷新
同步操作将从 element-plus/element-plus 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
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()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。