mirror of https://github.com/VERT-sh/VERT.git
feat: footer commit hash
This commit is contained in:
parent
7e73c505f8
commit
3b443e16be
|
|
@ -29,6 +29,8 @@ declare global {
|
|||
interface Window {
|
||||
plausible: TrackEvent;
|
||||
}
|
||||
|
||||
const __COMMIT_HASH__: string;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
[m["footer.source_code"](), GITHUB_URL_VERT],
|
||||
[m["footer.discord_server"](), DISCORD_URL],
|
||||
[m["footer.privacy_policy"](), "/privacy"],
|
||||
[__COMMIT_HASH__, `${GITHUB_URL_VERT}/commit/${__COMMIT_HASH__}`]
|
||||
]);
|
||||
|
||||
const year = new Date().getFullYear();
|
||||
|
|
|
|||
|
|
@ -3,6 +3,14 @@ import { sveltekit } from "@sveltejs/kit/vite";
|
|||
import { defineConfig, type PluginOption } from "vite";
|
||||
import svg from "@poppanator/sveltekit-svg";
|
||||
import wasm from "vite-plugin-wasm";
|
||||
import { execSync } from "child_process";
|
||||
|
||||
let commitHash = "unknown";
|
||||
try {
|
||||
commitHash = execSync("git rev-parse --short HEAD").toString().trim();
|
||||
} catch (e) {
|
||||
console.warn("Could not determine Git commit hash:", e);
|
||||
}
|
||||
|
||||
export default defineConfig(({ command }) => {
|
||||
const plugins: PluginOption[] = [
|
||||
|
|
@ -50,5 +58,8 @@ export default defineConfig(({ command }) => {
|
|||
build: {
|
||||
target: "esnext",
|
||||
},
|
||||
define: {
|
||||
__COMMIT_HASH__: JSON.stringify(commitHash),
|
||||
},
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue