From 35e01f0b01ada5024521174cd08ba6c7e3f7b09b Mon Sep 17 00:00:00 2001 From: Niko Date: Mon, 28 Apr 2025 19:20:12 +0200 Subject: [PATCH 1/2] Fix git version variable. --- astro.config.mjs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/astro.config.mjs b/astro.config.mjs index ae72868f8..4c3e57a4b 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -13,6 +13,11 @@ import deleteUnusedImages from "astro-delete-unused-images"; import preload from "astro-preload"; import { execSync } from "node:child_process"; +let gitVersion = ""; +try { + gitVersion = execSync("git rev-parse --short HEAD 2>&1 > /dev/null"); +} catch (e) {} + // https://astro.build/config export default defineConfig({ vite: { @@ -22,7 +27,7 @@ export default defineConfig({ .replace(/[-:T.Z]/g, "") .slice(0, 14), "import.meta.env.GIT_VERSION": new String( - execSync("git rev-parse --short HEAD") + gitVersion ), }, resolve: { From eed4e9040303edbab8c39f9356c79b4f36aa1ff6 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 28 Apr 2025 17:22:14 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- astro.config.mjs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/astro.config.mjs b/astro.config.mjs index 4c3e57a4b..81f39e18b 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -26,9 +26,7 @@ export default defineConfig({ .toISOString() .replace(/[-:T.Z]/g, "") .slice(0, 14), - "import.meta.env.GIT_VERSION": new String( - gitVersion - ), + "import.meta.env.GIT_VERSION": new String(gitVersion), }, resolve: { alias: {