Skip to content

Commit

Permalink
Get version hash from git while creating dist package
Browse files Browse the repository at this point in the history
  • Loading branch information
ctrlaltca committed Nov 26, 2013
1 parent bf092af commit f9720e7
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions buildscripts/phing/tasks/PradoVersionTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,8 @@ private function getPradoVersion()
*/
private function getPradoRevision()
{
$svnPath=dirname(__FILE__).'/../../../.svn';
if(is_file($svnPath.'/all-wcprops'))
$propFile=$svnPath.'/all-wcprops';
else if(is_file($svnPath.'/dir-wcprops'))
$propFile=$svnPath.'/dir-wcprops';
else
return 'unknown';
$contents=file_get_contents($propFile);
if(preg_match('/\\/svn\\/\\!svn\\/ver\\/(\d+)\\//ms',$contents,$matches)>0)
return $matches[1];
else
return 'unknown';
$rev=shell_exec("git log -1 --pretty=format:'%h'");
if($rev===null) $rev='unknown';
return $rev;
}
}

0 comments on commit f9720e7

Please sign in to comment.