diff options
| author | Joe Mou <dev@mou.fo> | 2026-09-03 15:07:25 -0400 |
|---|---|---|
| committer | Joe Mou <dev@mou.fo> | 2026-09-03 23:05:33 -0400 |
| commit | b9fb8851bb869a27048e02a51b28ef3aaffdd471 (patch) | |
| tree | f5a7fe469f83dc0bb0a745e6e3db14b12918d2f4 /scripts | |
| parent | a52481a3884447f94aad2d97e0407112c818a32d (diff) | |
Clean up renderer, redirects, and build commit
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/build.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/scripts/build.ts b/scripts/build.ts index 766e5e8..76d88a0 100644 --- a/scripts/build.ts +++ b/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`); |
