2024-08-20 06:39:00 -04:00
|
|
|
import { default as version } from "../version.json" with { type: "json" }
|
|
|
|
import { execSync } from "child_process"
|
2024-08-12 04:33:43 -04:00
|
|
|
let botVersion = version.botVersion
|
|
|
|
let gitCommit
|
|
|
|
let gitBranch
|
|
|
|
|
|
|
|
try {
|
2024-08-20 06:39:00 -04:00
|
|
|
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]
|
2024-08-12 04:33:43 -04:00
|
|
|
} catch (e) {
|
|
|
|
gitCommit = false
|
|
|
|
gitBranch = false
|
|
|
|
}
|
|
|
|
|
|
|
|
if (gitCommit) {
|
|
|
|
botVersion += ` (${gitCommit} - ${gitBranch})`
|
|
|
|
}
|
|
|
|
|
2024-08-20 06:39:00 -04:00
|
|
|
export default botVersion
|