fix: Command failed: git rev-parse --abbrev-ref HEAD
This commit is contained in:
parent
247ad78dbf
commit
12fd82778e
@ -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" />
|
||||
|
@ -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 + 生产环境才弹出
|
||||
|
Loading…
x
Reference in New Issue
Block a user