mirror of
https://github.com/rico-vz/HeimerdingerLoL.git
synced 2025-12-06 10:10:48 +01:00
feat: Add function to retrieve commit hash
- Added a new function `getCommitHash` to fetch the latest commit hash using Git log command and cache it for 3 days.
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
use App\Models\ChampionImage;
|
use App\Models\ChampionImage;
|
||||||
use Intervention\Image\Drivers\Gd\Driver;
|
use Intervention\Image\Drivers\Gd\Driver;
|
||||||
use Intervention\Image\ImageManager;
|
use Intervention\Image\ImageManager;
|
||||||
|
use Illuminate\Support\Facades\Cache;
|
||||||
|
|
||||||
function getRoleIcon($roleName): string
|
function getRoleIcon($roleName): string
|
||||||
{
|
{
|
||||||
@@ -83,3 +84,13 @@ function getChampionImage($full_id, $type): string
|
|||||||
|
|
||||||
return $championImage->url;
|
return $championImage->url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getCommitHash(): string
|
||||||
|
{
|
||||||
|
/** @var string $commit */
|
||||||
|
$commit = Cache::remember('commit_hash', 60 * 72, function () {
|
||||||
|
return trim(exec('git log --pretty="%h" -n1 HEAD'));
|
||||||
|
});
|
||||||
|
|
||||||
|
return $commit;
|
||||||
|
}
|
||||||
|
|||||||
@@ -53,5 +53,7 @@
|
|||||||
href="/" class="hover:underline">Heimerdinger.LoL</a> • Made with <a
|
href="/" class="hover:underline">Heimerdinger.LoL</a> • Made with <a
|
||||||
aria-label="Find out more about the creator of Heimerdinger.lol" href="https://rico.sh"><x-iconsax-bul-heart-circle
|
aria-label="Find out more about the creator of Heimerdinger.lol" href="https://rico.sh"><x-iconsax-bul-heart-circle
|
||||||
class="relative self-center inline-block w-5 text-red-400"/></a></span>
|
class="relative self-center inline-block w-5 text-red-400"/></a></span>
|
||||||
|
|
||||||
|
<span> <p class="mt-3 font-mono text-sm text-gray-200 opacity-75">Version: {{ getCommitHash() }}</p> </span>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
Reference in New Issue
Block a user