botv12/util/version.js

20 lines
477 B
JavaScript
Raw Normal View History

2024-11-19 20:05:19 -05:00
import version from '../version.js'
import { execSync } from 'child_process'
2024-10-23 23:35:21 -04:00
let botVersion = version.botVersion
let gitCommit
let gitBranch
try {
gitCommit = execSync('git rev-parse --short HEAD').toString('UTF-8').split('\n')[0]
gitBranch = execSync('git rev-parse --abbrev-ref HEAD').toString('UTF-8').split('\n')[0]
} catch (e) {
gitCommit = false
gitBranch = false
}
if (gitCommit) {
botVersion += ` (${gitCommit} - ${gitBranch})`
}
export default botVersion