From 0fde7efa6644dd749b1edc2b76c96c79b3e9b89d Mon Sep 17 00:00:00 2001 From: Nico Verbruggen Date: Sun, 22 Mar 2026 19:26:42 +0100 Subject: [PATCH] Link to specific commit tree --- web/build.mjs | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/web/build.mjs b/web/build.mjs index c6f177d..751c10a 100644 --- a/web/build.mjs +++ b/web/build.mjs @@ -86,29 +86,11 @@ async function build() { // Get git version string let versionStr = 'unknown'; let versionLink = 'https://github.com/nicoverbruggen/kobopatch-webui'; - const nixpacksCommit = process.env.SOURCE_COMMIT; try { - if (nixpacksCommit) { - versionStr = nixpacksCommit.slice(0, 7); - versionLink = `https://github.com/nicoverbruggen/kobopatch-webui/commit/${nixpacksCommit}`; - } else { - const hash = String(execSync('git rev-parse --short HEAD', { cwd: repoDir })).trim(); - - let tag = ''; - try { - tag = String(execSync('git describe --tags --exact-match 2>/dev/null', { cwd: repoDir })).trim(); - } catch {} - if (tag) { - versionStr = tag; - const dirty = String(execSync('git status --porcelain', { cwd: repoDir })).trim(); - if (dirty) versionStr += ' (D)'; - versionLink = `https://github.com/nicoverbruggen/kobopatch-webui/releases/tag/${tag}`; - } else { - const dirty = String(execSync('git status --porcelain', { cwd: repoDir })).trim(); - versionStr = dirty ? `${hash} (D)` : hash; - versionLink = `https://github.com/nicoverbruggen/kobopatch-webui/commit/${hash}`; - } - } + const fullHash = process.env.SOURCE_COMMIT + ?? String(execSync('git rev-parse HEAD', { cwd: repoDir })).trim(); + versionStr = fullHash.slice(0, 7); + versionLink = `https://github.com/nicoverbruggen/kobopatch-webui/tree/${fullHash}`; } catch {} // Generate cache-busted index.html