Files
ember-market-frontend/lib/git-utils.ts
2025-04-06 16:34:57 +01:00

22 lines
548 B
TypeScript

import gitInfo from "../public/git-info.json";
/**
* Git utility to load commit hash in both development and production environments
*/
interface GitInfo {
commitHash: string;
buildTime: string;
}
let cachedGitInfo: GitInfo | null = null;
/**
* Gets the current git commit hash from various sources
* - First tries environment variable (from Docker)
* - Then tries the JSON file created by our build script
* - Returns "dev" if nothing is available
*/
export async function getGitCommitInfo(): Promise<GitInfo> {
return gitInfo;
}