MCPcopy Create free account
hub / github.com/ZToolsCenter/ZTools / getGitCommitHash

Function getGitCommitHash

scripts/version-utils.mjs:6–14  ·  view source on GitHub ↗
(short = true)

Source from the content-addressed store, hash-verified

4
5// 获取Git commit hash
6export function getGitCommitHash(short = true) {
7 try {
8 const command = short ? 'git rev-parse --short HEAD' : 'git rev-parse HEAD'
9 return execSync(command, { encoding: 'utf-8' }).trim()
10 } catch (error) {
11 console.warn('Failed to get git commit hash:', error.message)
12 return 'unknown'
13 }
14}
15
16// 获取当前月份日期
17export function getCurrentMonthDate() {

Callers 1

getDevVersionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected