fix: Command failed: git rev-parse --abbrev-ref HEAD
This commit is contained in:
parent
247ad78dbf
commit
12fd82778e
@ -1,5 +1,5 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html build-time="%BUILD_TIME%" build-branch="%BUILD_BRANCH%">
|
<html build-time="%BUILD_TIME%">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
|
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
|
||||||
|
@ -92,11 +92,7 @@ export default ({ command, mode }) => {
|
|||||||
UNI_PLATFORM === 'h5' && {
|
UNI_PLATFORM === 'h5' && {
|
||||||
name: 'html-transform',
|
name: 'html-transform',
|
||||||
transformIndexHtml(html) {
|
transformIndexHtml(html) {
|
||||||
const branch = execSync('git rev-parse --abbrev-ref HEAD').toString().trim()
|
return html.replace('%BUILD_TIME%', dayjs().format('YYYY-MM-DD HH:mm:ss'))
|
||||||
console.log('branch -> ', branch)
|
|
||||||
return html
|
|
||||||
.replace('%BUILD_TIME%', dayjs().format('YYYY-MM-DD HH:mm:ss'))
|
|
||||||
.replace('%BUILD_BRANCH%', branch)
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// 打包分析插件,h5 + 生产环境才弹出
|
// 打包分析插件,h5 + 生产环境才弹出
|
||||||
|
Loading…
x
Reference in New Issue
Block a user