Seed from NAS prod snapshot 20260130-190531
This commit is contained in:
16
src/lib/buildInfo.ts
Normal file
16
src/lib/buildInfo.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { readFileSync } from "node:fs";
|
||||
|
||||
type Pkg = { version?: string };
|
||||
|
||||
function readPkgVersion(): string {
|
||||
try {
|
||||
const raw = readFileSync(new URL("../../package.json", import.meta.url), "utf-8");
|
||||
const pkg = JSON.parse(raw) as Pkg;
|
||||
return pkg.version ?? "0.0.0";
|
||||
} catch {
|
||||
return "0.0.0";
|
||||
}
|
||||
}
|
||||
|
||||
export const SITE_RELEASE = process.env.PUBLIC_RELEASE || readPkgVersion();
|
||||
export const BUILD_TIME_ISO = new Date().toISOString();
|
||||
Reference in New Issue
Block a user