From 961913b88a3208924eba14a9602b853d9e6de8ce Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 20 Oct 2023 16:21:35 +0200 Subject: [PATCH] Use version from environment --- packages/backend-core/src/environment.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/backend-core/src/environment.ts b/packages/backend-core/src/environment.ts index 3894bdd0f7..4fb8b5fdca 100644 --- a/packages/backend-core/src/environment.ts +++ b/packages/backend-core/src/environment.ts @@ -49,7 +49,6 @@ function httpLogging() { } function getPackageJsonFields(): { - VERSION: string SERVICE_NAME: string } { function findFileInAncestors( @@ -75,12 +74,11 @@ function getPackageJsonFields(): { const content = readFileSync(packageJsonFile!, "utf-8") const parsedContent = JSON.parse(content) return { - VERSION: parsedContent.version, SERVICE_NAME: parsedContent.name, } } catch { // throwing an error here is confusing/causes backend-core to be hard to import - return { VERSION: "", SERVICE_NAME: "" } + return { SERVICE_NAME: "" } } } @@ -173,6 +171,7 @@ const environment = { ENABLE_SSO_MAINTENANCE_MODE: selfHosted ? process.env.ENABLE_SSO_MAINTENANCE_MODE : false, + VERSION: process.env.VERSION!, ...getPackageJsonFields(), DISABLE_PINO_LOGGER: process.env.DISABLE_PINO_LOGGER, OFFLINE_MODE: process.env.OFFLINE_MODE,