Skip to content

Commit

Permalink
fix: Command failed: git rev-parse --abbrev-ref HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
feige996 committed Jun 19, 2024
1 parent 247ad78 commit 12fd827
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!doctype html>
<html build-time="%BUILD_TIME%" build-branch="%BUILD_BRANCH%">
<html build-time="%BUILD_TIME%">
<head>
<meta charset="UTF-8" />
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
Expand Down
6 changes: 1 addition & 5 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 + 生产环境才弹出
Expand Down

0 comments on commit 12fd827

Please sign in to comment.