From 84d594ad0b6720be5236bdf07491dc0920be509c Mon Sep 17 00:00:00 2001 From: Lea Date: Sun, 20 Aug 2023 15:56:59 +0200 Subject: [PATCH] fix: show commit hash and branch instead of v0.0.1 --- app/panel/sparkle/page.tsx | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/app/panel/sparkle/page.tsx b/app/panel/sparkle/page.tsx index 4500dc3..c40d040 100644 --- a/app/panel/sparkle/page.tsx +++ b/app/panel/sparkle/page.tsx @@ -1,7 +1,25 @@ +import { execSync } from "child_process"; + export default function Sparkle() { + const hash = execSync("git rev-parse HEAD", { cwd: process.cwd() }).toString().trim(); + const branch = execSync("git rev-parse --abbrev-ref HEAD", { cwd: process.cwd() }).toString().trim(); + return (
-

Running version v0.0.1

+

+ Running version + + + {hash.substring(0, 10)} + + + on branch + + + {branch} + + +