Files
plainleaf/cmd/update_version.ts
T

21 lines
580 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}`,
);
}