Bilibili-Evolved/webpack/compilation-info.js
2021-10-26 13:19:37 +08:00

29 lines
586 B
JavaScript

const process = require('child_process')
const commitHash = process
.execSync('git rev-parse HEAD')
.toString()
.trim()
const branch = process
.execSync('git rev-parse --abbrev-ref HEAD')
.toString()
.trim()
const nearestTag = process
.execSync('git describe --abbrev=0 --tags --always')
.toString()
.trim()
const versionWithTag = process
.execSync('git describe --tags --always')
.toString()
.trim()
const compilationInfo = {
commitHash,
branch,
nearestTag,
versionWithTag,
// buildTime: Number(new Date()),
}
module.exports = {
compilationInfo,
}