(short = true)
| 4 | |
| 5 | // 获取Git commit hash |
| 6 | export 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 | // 获取当前月份日期 |
| 17 | export function getCurrentMonthDate() { |