1
0
Fork 0

Simplify tag probe

pull/3538/head
Jordi Boggiano 2014-12-09 22:39:59 +00:00
parent 6cbf0d9ae0
commit 2131c8b480
1 changed files with 2 additions and 5 deletions

View File

@ -55,12 +55,9 @@ class Compiler
$date->setTimezone(new \DateTimeZone('UTC')); $date->setTimezone(new \DateTimeZone('UTC'));
$this->versionDate = $date->format('Y-m-d H:i:s'); $this->versionDate = $date->format('Y-m-d H:i:s');
$process = new Process('git name-rev --tags --name-only $(git rev-parse HEAD)'); $process = new Process('git describe --tags --exact-match HEAD');
if ($process->run() == 0) { if ($process->run() == 0) {
$output = trim($process->getOutput()); $this->version = trim($process->getOutput());
if ($output != 'undefined') {
$this->version = $output;
}
} else { } else {
// get branch-alias defined in composer.json for dev-master (if any) // get branch-alias defined in composer.json for dev-master (if any)
$localConfig = __DIR__.'/../../composer.json'; $localConfig = __DIR__.'/../../composer.json';