fix(update): fix version fetch logic

This commit is contained in:
xboard
2025-02-09 14:24:49 +08:00
parent 7ac2e2e2ed
commit 0f80ab8d5f

View File

@@ -254,6 +254,8 @@ class UpdateService
protected function getCurrentCommit(): string
{
try {
// Ensure git configuration is correct
Process::run(sprintf('git config --global --add safe.directory %s', base_path()));
$result = Process::run('git rev-parse HEAD');
$fullHash = trim($result->output());
return $fullHash ? $this->formatCommitHash($fullHash) : 'unknown';