Skip to content

Commit

Permalink
🐛 Version Controller not showing current Version in Changelog (#2110)
Browse files Browse the repository at this point in the history
  • Loading branch information
HerrLevin authored Nov 10, 2023
1 parent 827a5cc commit 3de2f81
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/Http/Controllers/Backend/VersionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ abstract class VersionController extends Controller
{
public static function getVersion(): bool|string {
if (file_exists(base_path() . '/VERSION')) {
return file_get_contents(base_path() . '/VERSION');
return trim(file_get_contents(base_path() . '/VERSION'));
}
return self::getCurrentGitCommit();
return trim(self::getCurrentGitCommit());
}

private static function get_git_HEAD(): bool|string {
private static function getGitHead(): bool|string {
if ($head = @file_get_contents(base_path() . '/.git/HEAD')) {
return substr($head, 5, -1);
}
Expand All @@ -23,7 +23,7 @@ private static function get_git_HEAD(): bool|string {

private static function getCurrentGitCommit(): bool|string {
try {
if ($hash = @file_get_contents(base_path() . '/.git/' . self::get_git_HEAD())) {
if ($hash = @file_get_contents(base_path() . '/.git/' . self::getGitHead())) {
return $hash;
}
} catch (Exception $exception) {
Expand Down

0 comments on commit 3de2f81

Please sign in to comment.