Explorar el Código

Merge pull request #384 from simensen/TagForPackageVersion

Use tag as package version if built off of a tag
Jordi Boggiano hace 13 años
padre
commit
5f40acef48
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  1. 5 0
      src/Composer/Compiler.php

+ 5 - 0
src/Composer/Compiler.php

@@ -41,6 +41,11 @@ class Compiler
         }
         $this->version = trim($process->getOutput());
 
+        $process = new Process('git describe --tags HEAD');
+        if ($process->run() == 0) {
+            $this->version = trim($process->getOutput());
+        }
+
         $phar = new \Phar($pharFile, 0, 'composer.phar');
         $phar->setSignatureAlgorithm(\Phar::SHA1);