fix: footer commit hash coolify fix

This commit is contained in:
Maya 2025-12-19 21:32:59 +03:00
parent 6ac287e434
commit 4ee188cb72
No known key found for this signature in database
1 changed files with 10 additions and 5 deletions

View File

@ -5,11 +5,16 @@ 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);
// coollify removes the .git folder but exposes commit via SOURCE_COMMIT env variable
let commitHash = process.env.SOURCE_COMMIT || "unknown";
if (commitHash === "unknown") {
try {
commitHash = execSync("git rev-parse --short HEAD").toString().trim();
} catch (e) {
console.warn(`Could not determine Git commit hash: ${e}`);
commitHash = "unknown";
}
}
export default defineConfig(({ command }) => {