1
0
Fork 0

fix: show commit hash and branch instead of v0.0.1

user-stream
Lea 2023-08-20 15:56:59 +02:00
parent 3f5ec1f2ef
commit 84d594ad0b
Signed by: lea
GPG Key ID: 1BAFFE8347019C42
1 changed files with 19 additions and 1 deletions

View File

@ -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 (
<div>
<h1 className="text-xl text-center">Running version v0.0.1</h1>
<h1 className="text-xl text-center">
<span>Running version </span>
<code>
<a href={`https://git.revolt.chat/administration/panel/commit/${hash}`} target="_blank">
{hash.substring(0, 10)}
</a>
</code>
<span> on branch </span>
<code>
<a href={`https://git.revolt.chat/administration/panel/src/branch/${branch}`} target="_blank">
{branch}
</a>
</code>
</h1>
<img
className="absolute right-0 bottom-0"
src="https://api.gifbox.me/file/posts/MF3oORlDjfHAVJ-DgPyRQSjMdy9WNIxk.webp"