vlw.se/public/about/version.php

17 lines
No EOL
538 B
PHP

<?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.
*/
// Get tags from local git folder
$dir = scandir(VV::root(".git/refs/tags"));
// Get current version number from latest tag
$version = end($dir);
?>
<a href="https://github.com/victorwesterlund/vlw.se/releases/<?= $version ?>"><?= $version ?></a>