feat: include build branch in messages

This commit is contained in:
PalmDevs 2025-05-01 18:53:16 +07:00
parent 743353d20e
commit 058371988a
No known key found for this signature in database
GPG key ID: 6FAE8F8677ACA8BA
3 changed files with 3 additions and 2 deletions

View file

@ -49,7 +49,7 @@ function runCatching(fn: () => void) {
// TODO(init): Move to use native module
alert(
// biome-ignore lint/style/useTemplate: I want this to be readable, thank you
`Failed to load Revenge (v: ${__BUILD_VERSION__} c: ${__BUILD_COMMIT__} e: ${__BUILD_ENV__})\n` +
`Failed to load Revenge (v: ${__BUILD_VERSION__} r: ${__BUILD_COMMIT__}-${__BUILD_BRANCH__}-${__BUILD_ENV__})\n` +
`Discord: ${ClientInfoModule.Version} (${ClientInfoModule.Build})\n` +
`Device: ${DeviceModule.deviceManufacturer} ${DeviceModule.deviceModel}\n\n` +
getErrorStack(e),

View file

@ -29,6 +29,7 @@ export default async function build(dev = false, log = true) {
define: {
__BUILD_VERSION__: JSON.stringify(pkg.version),
__BUILD_COMMIT__: JSON.stringify((await $`git rev-parse HEAD`.text()).substring(0, 7)),
__BUILD_BRANCH__: JSON.stringify(await $`git rev-parse --abbrev-ref HEAD`.text()),
__BUILD_ENV__: JSON.stringify(dev ? 'development' : 'production'),
__BUILD_FLAG_INIT_DISABLE_PATCH_LOG_PROMISE_REJECTIONS__: String(!dev),
},

View file

@ -24,7 +24,7 @@ registerPlugin(
start({ logger }) {
AppStartPerformance.mark('👊', 'Plugins start', performance.now() - tsInit)
logger.log(
`👊 Revenge. Discord, your way. (v: ${__BUILD_VERSION__} c: ${__BUILD_COMMIT__} e: ${__BUILD_ENV__})`,
`👊 Revenge. Discord, your way. (v: ${__BUILD_VERSION__} r: ${__BUILD_COMMIT__}-${__BUILD_BRANCH__}-${__BUILD_ENV__})`,
)
},
},