summaryrefslogtreecommitdiff
path: root/cgithub/scripts/build.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cgithub/scripts/build.ts')
-rw-r--r--cgithub/scripts/build.ts12
1 files changed, 6 insertions, 6 deletions
diff --git a/cgithub/scripts/build.ts b/cgithub/scripts/build.ts
index 766e5e8..76d88a0 100644
--- a/cgithub/scripts/build.ts
+++ b/cgithub/scripts/build.ts
@@ -3,7 +3,7 @@
// src/views.generated.ts - views/*.eta precompiled into plain functions.
// Workers disallow runtime code generation (`new Function`), so Eta cannot
// compile templates there at request time.
-// src/commit.generated.ts - the commit this build was made from, for the
+// src/build.generated.ts - the commit this build was made from, for the
// page footer. Workers can't shell out to git at request time either.
import { execFileSync } from "node:child_process";
import { Eta } from "eta";
@@ -35,9 +35,9 @@ console.log(`Compiled ${names.length} templates to src/views.generated.ts`);
// Untagged repositories describe as a bare short hash; --dirty marks a build
// made from an unclean working copy.
-let commit = "unknown";
+let buildCommit = "unknown";
try {
- commit = execFileSync("git", ["describe", "--tags", "--always", "--dirty"], {
+ buildCommit = execFileSync("git", ["describe", "--tags", "--always", "--dirty"], {
cwd: root,
encoding: "utf8",
}).trim();
@@ -46,7 +46,7 @@ try {
}
fs.writeFileSync(
- path.join(root, "src", "commit.generated.ts"),
- `// Generated by scripts/build.ts -- do not edit.\nexport const commit = ${JSON.stringify(commit)};\n`,
+ path.join(root, "src", "build.generated.ts"),
+ `// Generated by scripts/build.ts -- do not edit.\nexport const buildCommit = ${JSON.stringify(buildCommit)};\n`,
);
-console.log(`Wrote commit ${commit} to src/commit.generated.ts`);
+console.log(`Wrote commit ${buildCommit} to src/build.generated.ts`);