diff --git a/public/login.html b/public/login.html index c63dffc..0ad04ec 100644 --- a/public/login.html +++ b/public/login.html @@ -65,11 +65,6 @@ .catch(function () {}); + diff --git a/src/version.js b/src/version.js index 1ff6d83..f1a8169 100644 --- a/src/version.js +++ b/src/version.js @@ -22,16 +22,20 @@ function formatDateTime(d) { ); } +function shortenHash(hash) { + return (hash || "unknown").slice(0, 8); +} + function resolveCommitHash() { if (process.env.GIT_COMMIT && process.env.GIT_COMMIT !== "unknown" && process.env.GIT_COMMIT !== "") { - return process.env.GIT_COMMIT; + return shortenHash(process.env.GIT_COMMIT); } try { const hash = execFileSync("git", ["rev-parse", "--short=8", "HEAD"], { encoding: "utf8", stdio: ["ignore", "pipe", "ignore"], }).trim(); - return hash || "unknown"; + return shortenHash(hash); } catch { return "unknown"; }