mirror of
https://codeberg.org/vlw/vlw.se.git
synced 2025-09-13 21:13:40 +02:00

* wip: 2024-02-13T12:59:17+0100 (1707825557) * wip: 2024-02-21T03:16:48+0100 (1708481808) * wip: 2024-02-21T20:50:20+0100 (1708545020) * wip: 2024-02-21T20:50:20+0100 (1708545020) * wip: 2024-03-01T13:17:58+0100 (1709295478) * wip: 2024-03-06T12:06:58+0100 (1709723218) * wip: 2024-03-07T15:07:57+0100 (1709820477) * wip: 2024-03-09T01:36:44+0100 (1709944604) * wip: 2024-03-14T23:24:12+0100 (1710455052) * wip: 2024-03-28T18:27:40+0100 (1711646860) * wip: 2024-03-28T18:27:40+0100 (1711646860) * feat: create README * wip: 2024-04-01T12:21:45+0200 (1711966905)
19 lines
No EOL
590 B
PHP
Executable file
19 lines
No EOL
590 B
PHP
Executable file
<?php
|
|
|
|
/*
|
|
A pretty naive website version fetcher that assumes the latest git tag is the
|
|
version the website is currently displaying. The intent is that any live-master
|
|
of this website should always track the master branch and pull the latest HEAD
|
|
without any exceptions.
|
|
*/
|
|
|
|
use Vegvisir\Path;
|
|
|
|
// Get tags from local git folder
|
|
$dir = scandir(Path::root(".git/refs/tags"), SCANDIR_SORT_ASCENDING);
|
|
|
|
// Get current version number from latest tag
|
|
$version = $dir[2] ?? "";
|
|
|
|
?>
|
|
<a href="https://github.com/victorwesterlund/vlw.se/releases/<?= $version ?>"><?= $version ?></a>
|