Created
July 28, 2020 10:49
-
-
Save robertannett/309db7c2f30341cb77402c8ba0c08866 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
class ApplicationVersion extends \Base | |
{ | |
public static function get() | |
{ | |
$commitHash = trim(exec('git log --pretty="%h" -n1 HEAD')); | |
$release = trim(exec('git tag')); | |
return sprintf('%s-r%s', $commitHash, $release); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment