2024-08-03 03:24:56 -04:00
|
|
|
const version = require('../version.json')
|
|
|
|
const cp = require('child_process')
|
|
|
|
|
|
|
|
let botVersion = version.botVersion
|
|
|
|
let gitCommit
|
|
|
|
let gitBranch
|
|
|
|
|
|
|
|
try {
|
|
|
|
gitCommit = cp.execSync('git rev-parse --short HEAD').toString('UTF-8').split('\n')[0]
|
|
|
|
gitBranch = cp.execSync('git rev-parse --abbrev-ref HEAD').toString('UTF-8').split('\n')[0]
|
|
|
|
} catch (e) {
|
|
|
|
gitCommit = false
|
|
|
|
gitBranch = false
|
|
|
|
}
|
2024-08-04 01:30:28 -04:00
|
|
|
|
2024-08-03 03:24:56 -04:00
|
|
|
if (gitCommit) {
|
|
|
|
botVersion += ` (${gitCommit} - ${gitBranch})`
|
|
|
|
}
|
|
|
|
|
2024-08-04 01:41:32 -04:00
|
|
|
module.exports = botVersion
|