Skip to content

Instantly share code, notes, and snippets.

View michielgerritsen's full-sized avatar
👑
Test all the thing ✅

Michiel Gerritsen michielgerritsen

👑
Test all the thing ✅
View GitHub Profile
@michielgerritsen
michielgerritsen / gittag.php
Last active April 11, 2017 14:23
Retrieve the latest tag, based on the sorted version - https://packagist.org/packages/controlaltdelete/git-version
/**
* Retrieve the git version number so we can show it.
*/
$files = [];
$dir = dirname(dirname(dirname(__FILE__))) . '/.git/refs/tags';
if(file_exists($dir)) {
foreach (new DirectoryIterator($dir) as $file) {
if ($file->isDot()) {
continue;
}