diff --git a/app/Console/Commands/CheckUpdates.php b/app/Console/Commands/CheckUpdates.php index df45ca2..5309497 100644 --- a/app/Console/Commands/CheckUpdates.php +++ b/app/Console/Commands/CheckUpdates.php @@ -61,15 +61,21 @@ class CheckUpdates extends Command private function readInstalledVersionNorm(): ?string { + // Lokal: git describe gibt immer den aktuellen Stand + if (app()->isLocal()) { + $tag = @trim((string) shell_exec('git -C ' . escapeshellarg(base_path()) . ' describe --tags --abbrev=0 2>/dev/null')); + $v = $this->normalizeVersion($tag); + if ($v) return $v; + } + $paths = [ - '/var/lib/mailwolt/version', // vom Wrapper (normiert) - base_path('VERSION'), // App-Fallback + '/var/lib/mailwolt/version', + base_path('VERSION'), ]; foreach ($paths as $p) { $raw = @trim(@file_get_contents($p) ?: ''); if ($raw !== '') return $this->normalizeVersion($raw); } - // Noch ein Fallback aus RAW-Datei $raw = $this->readInstalledVersionRaw(); return $raw ? $this->normalizeVersion($raw) : null; } diff --git a/app/Livewire/Ui/System/UpdatePage.php b/app/Livewire/Ui/System/UpdatePage.php index c85b172..21c8aa9 100644 --- a/app/Livewire/Ui/System/UpdatePage.php +++ b/app/Livewire/Ui/System/UpdatePage.php @@ -255,6 +255,13 @@ class UpdatePage extends Component protected function readCurrentVersion(): ?string { + // Lokal: direkt aus git describe lesen damit Entwicklungsumgebung immer aktuell ist + if (app()->isLocal()) { + $tag = @trim((string) shell_exec('git -C ' . escapeshellarg(base_path()) . ' describe --tags --abbrev=0 2>/dev/null')); + $v = $this->normalizeVersion($tag); + if ($v) return $v; + } + $v = @trim(@file_get_contents(self::VERSION_FILE) ?: ''); if ($v !== '') return $v;