Fix Git Info API: Use absolute path to git binary

This commit is contained in:
2025-12-27 22:52:33 +11:00
parent 7cc2a94dd0
commit 18b3c339fe

View File

@@ -14,13 +14,15 @@ app.use('/reports', express.static(path.join(__dirname, 'reports')));
// API Endpoint: Git Info // API Endpoint: Git Info
app.get("/api/git-info", (req, res) => { app.get("/api/git-info", (req, res) => {
exec('git log -1 --format="%H|%cr"', (error, stdout, stderr) => { exec('/usr/bin/git log -1 --format="%H|%cr"', (error, stdout, stderr) => {
if (error) { if (error) {
console.error("Error getting git info:", error); console.error("Error getting git info:", error);
console.error("Stderr:", stderr);
return res.json({ return res.json({
commitId: "unknown", commitId: "unknown",
commitAge: "unknown", commitAge: "dev mode",
error: true, error: true,
details: error.message
}); });
} }