From e0e2724db4ebab9f93ad3a60cd1f9fdffeafd9a9 Mon Sep 17 00:00:00 2001 From: michele Date: Wed, 8 Apr 2026 22:10:04 +0000 Subject: [PATCH] Fix update launcher empty path --- app/Filament/Pages/Supporto/Modifiche.php | 24 ++++++++--------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/app/Filament/Pages/Supporto/Modifiche.php b/app/Filament/Pages/Supporto/Modifiche.php index ab2cfb4..0472edf 100644 --- a/app/Filament/Pages/Supporto/Modifiche.php +++ b/app/Filament/Pages/Supporto/Modifiche.php @@ -1218,36 +1218,28 @@ private function loadDevelopmentSnapshot(): void private function loadFunctionalHighlights(): void { - $repoPath = $this->resolveGitWorkspacePath(); - $this->gitWorkspacePath = $repoPath; - $this->gitCurrentBranch = $this->runGitProcessAt($repoPath, ['rev-parse', '--abbrev-ref', 'HEAD']); - $this->gitCurrentCommit = $this->runGitProcessAt($repoPath, ['rev-parse', '--short', 'HEAD']); - $this->gitCurrentCommitDate = $this->runGitProcessAt($repoPath, ['show', '-s', '--date=format:%d/%m/%Y %H:%M', '--format=%cd', 'HEAD']); - $this->gitRemoteCommit = $this->runGitProcessAt($repoPath, ['rev-parse', '--short', 'refs/remotes/' . $this->gitRemote . '/' . $this->gitBranch]); - $this->gitRemoteCommitDate = $this->runGitProcessAt($repoPath, ['show', '-s', '--date=format:%d/%m/%Y %H:%M', '--format=%cd', 'refs/remotes/' . $this->gitRemote . '/' . $this->gitBranch]); - $this->gitWorkingTreeDirty = trim((string) ($this->runGitProcessAt($repoPath, ['status', '--porcelain']) ?? '')) !== ''; + $this->functionalHighlights = []; + + $path = base_path('docs/NETGESCON-MODIFICHE.md'); + if (! is_file($path)) { + return; + } $lines = preg_split('/\r\n|\r|\n/', (string) @file_get_contents($path)) ?: []; foreach ($lines as $line) { - $aheadBehind = $this->runGitProcessAt($repoPath, ['rev-list', '--left-right', '--count', 'HEAD...refs/remotes/' . $this->gitRemote . '/' . $this->gitBranch]); + $line = trim((string) $line); if ($line === '') { continue; } if (! str_starts_with($line, '-')) { - $this->gitAheadBehind = $repoPath === null ? 'non disponibile' : '-'; + continue; } if (! str_contains($line, '[U]') && ! str_contains($line, '[P]')) { continue; } - $this->gitCurrentBranch = $this->gitCurrentBranch ?: (isset($summary['branch']) ? (string) $summary['branch'] : null); - $this->gitCurrentCommit = $this->gitCurrentCommit ?: (isset($summary['after_commit']) ? (string) $summary['after_commit'] : (isset($summary['before_commit']) ? (string) $summary['before_commit'] : null)); - $this->gitRemoteCommit = $this->gitRemoteCommit ?: (isset($summary['remote_commit']) ? (string) $summary['remote_commit'] : $this->gitCurrentCommit); - $syncDate = isset($summary['synced_at']) ? (string) $summary['synced_at'] : null; - $this->gitCurrentCommitDate = $this->gitCurrentCommitDate ?: $syncDate; - $this->gitRemoteCommitDate = $this->gitRemoteCommitDate ?: $syncDate; $this->functionalHighlights[] = trim(ltrim($line, '- ')); if (count($this->functionalHighlights) >= 30) { break;