Skip to content

Commit fe26e5e

Browse files
authored
chore(web): include commit time in index.html (netless-io#1660)
1 parent 4b7d535 commit fe26e5e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

web/flat-web/scripts/vite-plugin-html-hash.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,13 @@ export function injectHtmlHash(): Plugin {
2323
// so using the function
2424
const gitHash = (): string => {
2525
try {
26-
return execSync("git rev-parse HEAD", {
26+
const hash = execSync("git rev-parse HEAD", {
2727
encoding: "utf-8",
2828
}).trim();
29+
const time = execSync(`git show ${hash} --pretty=%cI --no-patch --no-notes`, {
30+
encoding: "utf-8",
31+
}).trim();
32+
return [hash, time].join(" ");
2933
} catch {
3034
return "NOT_A_GIT_REPO";
3135
}

0 commit comments

Comments
 (0)