Skip to content

Commit 28d0e8b

Browse files
committed
fix: gitHash not in build script
1 parent 29337ef commit 28d0e8b

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/utils/screenLog.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable */
22
export const printANSI = () => {
33
// console.clear()
4-
console.log('[Antd Pro] created()')
4+
console.log('[antd pro] created()')
55
// ASCII - ANSI Shadow
66
let text = `
77
█████╗ ███╗ ██╗████████╗██████╗ ██████╗ ██████╗ ██████╗
@@ -13,6 +13,6 @@ export const printANSI = () => {
1313
\t\t\t\t\tPublished ${APP_VERSION}-${GIT_HASH} @ antdv.com
1414
\t\t\t\t\tBuild date: ${BUILD_DATE}`
1515
console.log(`%c${text}`, 'color: #fc4d50')
16-
console.log('%c感谢使用 Antd Vue Pro!', 'color: #000; font-size: 14px; font-family: Hiragino Sans GB,Microsoft YaHei,\\\\5FAE\\8F6F\\96C5\\9ED1,Droid Sans Fallback,Source Sans,Wenquanyi Micro Hei,WenQuanYi Micro Hei Mono,WenQuanYi Zen Hei,Apple LiGothic Medium,SimHei,ST Heiti,WenQuanYi Zen Hei Sharp,sans-serif;')
17-
console.log('%cThanks for using Antd Vue Pro!', 'color: #fff; font-size: 14px; font-weight: 300; text-shadow:#000 1px 0 0,#000 0 1px 0,#000 -1px 0 0,#000 0 -1px 0;')
16+
console.log('%c感谢使用 antd pro!', 'color: #000; font-size: 14px; font-family: Hiragino Sans GB,Microsoft YaHei,\\\\5FAE\\8F6F\\96C5\\9ED1,Droid Sans Fallback,Source Sans,Wenquanyi Micro Hei,WenQuanYi Micro Hei Mono,WenQuanYi Zen Hei,Apple LiGothic Medium,SimHei,ST Heiti,WenQuanYi Zen Hei Sharp,sans-serif;')
17+
console.log('%cThanks for using antd pro!', 'color: #fff; font-size: 14px; font-weight: 300; text-shadow:#000 1px 0 0,#000 0 1px 0,#000 -1px 0 0,#000 0 -1px 0;')
1818
}

vue.config.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ function resolve (dir) {
99
return path.join(__dirname, dir)
1010
}
1111

12+
// check Git
13+
function getGitHash () {
14+
try {
15+
return GitRevision.version()
16+
} catch (e) {}
17+
return 'unknown'
18+
}
19+
1220
const isProd = process.env.NODE_ENV === 'production'
1321

1422
const assetsCDN = {
@@ -38,7 +46,7 @@ const vueConfig = {
3846
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
3947
new webpack.DefinePlugin({
4048
APP_VERSION: `"${require('./package.json').version}"`,
41-
GIT_HASH: JSON.stringify(GitRevision.version()),
49+
GIT_HASH: JSON.stringify(getGitHash()),
4250
BUILD_DATE: buildDate
4351
})
4452
],

0 commit comments

Comments
 (0)