From bd627a6e54cc98d60480bc3840c3d0ae30a782d4 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Sun, 30 Jun 2024 07:34:15 +0530 Subject: [PATCH] Case --- web/packages/next/log-web.ts | 2 +- web/packages/next/next.config.base.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/web/packages/next/log-web.ts b/web/packages/next/log-web.ts index 5b809875c1..bf24741b09 100644 --- a/web/packages/next/log-web.ts +++ b/web/packages/next/log-web.ts @@ -11,7 +11,7 @@ import type { AppName } from "./types/app"; * @param userId The uid for the currently logged in user, if any. */ export const logStartupBanner = (appName: AppName, userId?: number) => { - const sha = process.env.GIT_SHA; + const sha = process.env.gitSHA; const buildId = isDevBuild ? "dev " : sha ? `git ${sha} ` : ""; log.info(`Starting ente-${appName}-web ${buildId}uid ${userId ?? 0}`); }; diff --git a/web/packages/next/next.config.base.js b/web/packages/next/next.config.base.js index ce1005e11b..b658089e11 100644 --- a/web/packages/next/next.config.base.js +++ b/web/packages/next/next.config.base.js @@ -17,7 +17,7 @@ const path = require("path"); /** * Return the current commit ID if we're running inside a git repository. */ -const gitSHA = () => { +const gitSHA = (() => { // Allow the command to fail. gitSHA will be an empty string in such cases. // This allows us to run the build even when we're outside of a git context. // @@ -38,7 +38,7 @@ const gitSHA = () => { // Convert empty strings (e.g. when the `|| true` part of the above execSync // comes into play) to undefined. return result ? result : undefined; -}; +})(); /** * The name of the Ente app we're building. @@ -79,9 +79,9 @@ const nextConfig = { transpilePackages: ["@/next", "@/utils", "@/new"], // Add environment variables to the JavaScript bundle. They will be - // available as `process.env.VAR_NAME` to our code. + // available as `process.env.varName` to our code. env: { - GIT_SHA: gitSHA(), + gitSHA, appName, isDesktop, },