From 12fd82778eea695cafa8550b5becc63a156db293 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=B2=E9=B8=BD?= <1020103647@qq.com> Date: Wed, 19 Jun 2024 14:09:12 +0800 Subject: [PATCH] fix: Command failed: git rev-parse --abbrev-ref HEAD --- index.html | 2 +- vite.config.ts | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index 21a5c37..2e368d0 100644 --- a/index.html +++ b/index.html @@ -1,5 +1,5 @@ - + diff --git a/vite.config.ts b/vite.config.ts index cee915b..1d5bfff 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -92,11 +92,7 @@ export default ({ command, mode }) => { UNI_PLATFORM === 'h5' && { name: 'html-transform', transformIndexHtml(html) { - const branch = execSync('git rev-parse --abbrev-ref HEAD').toString().trim() - console.log('branch -> ', branch) - return html - .replace('%BUILD_TIME%', dayjs().format('YYYY-MM-DD HH:mm:ss')) - .replace('%BUILD_BRANCH%', branch) + return html.replace('%BUILD_TIME%', dayjs().format('YYYY-MM-DD HH:mm:ss')) }, }, // 打包分析插件,h5 + 生产环境才弹出