Files
plainleaf/cmd/update_version.ts
T
2025-09-03 09:06:10 +02:00

19 lines
578 B
TypeScript

export async function updateVersionFile() {
const command = new Deno.Command("git", {
args: ["describe", "--tags", "--long"],
stdout: "piped",
stderr: "piped",
});
const { stdout } = await command.output();
const commitVersion = new TextDecoder().decode(stdout).trim();
const versionFilePath = "./public_version.ts";
const versionContent = `export const publicVersion = "${commitVersion}";`;
await Deno.writeTextFile(versionFilePath, versionContent);
console.log(
`Updated public_version.ts with version information: ${commitVersion}`,
);
}