memos-rss/cli/git-commit-build.ts
2025-12-11 01:16:37 +09:00

13 lines
No EOL
338 B
TypeScript

async function getGitCommitHash(): Promise<string> {
try {
const proc = Bun.spawn(["git", "rev-parse", "--short", "HEAD"]);
const text = await new Response(proc.stdout).text();
return text.trim();
} catch {
return "unknown";
}
}
Bun.file("version").write(await getGitCommitHash());
export {};