From 979e2361fb403bddd6e11244cb2c0613914fd65f Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Sat, 6 Apr 2024 14:35:49 +0100 Subject: [PATCH] add commit hash to footer * closes #5 --- components/Footer/Footer.module.css | 2 +- components/Footer/Footer.tsx | 16 +++++++++------- package.json | 4 ++-- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/components/Footer/Footer.module.css b/components/Footer/Footer.module.css index f3bfdb9..9a2aed4 100644 --- a/components/Footer/Footer.module.css +++ b/components/Footer/Footer.module.css @@ -14,7 +14,7 @@ justify-content: space-between; } -.footer a { +.footer a:not(.commitHash) { color: rgba(var(--foreground-rgb), 0.8); } diff --git a/components/Footer/Footer.tsx b/components/Footer/Footer.tsx index 869de1a..21f62c6 100644 --- a/components/Footer/Footer.tsx +++ b/components/Footer/Footer.tsx @@ -12,18 +12,20 @@ export function Footer() {

+ + {process.env.GIT_COMMIT_SHA?.substring(0, 7)} +

- {/*
-

- - {process.env.VERCEL_GIT_COMMIT_SHA?.substring(0, 7)} - -

-
*/} +
+

+
) } diff --git a/package.json b/package.json index 093b160..d851722 100644 --- a/package.json +++ b/package.json @@ -3,8 +3,8 @@ "version": "0.1.0", "private": true, "scripts": { - "dev": "next dev", - "build": "next build", + "dev": "export GIT_COMMIT_SHA=$(git rev-parse HEAD) && next dev", + "build": "export GIT_COMMIT_SHA=$(git rev-parse HEAD) && next build", "start": "next start", "lint": "next lint", "typecheck": "tsc --noEmit",