Merge pull request #176 from vbardales/fix-build-command
create sql folder if not exists + CS
This commit is contained in:
commit
ea7653d2c7
|
@ -63,6 +63,10 @@ EOT
|
|||
$filesystem->remove($cacheDir);
|
||||
$filesystem->mkdir($cacheDir);
|
||||
|
||||
if (!$filesystem->exists($sqlDir)) {
|
||||
$filesystem->mkdir($sqlDir);
|
||||
}
|
||||
|
||||
// Execute the task
|
||||
$ret = $this->callPhing('build-sql', array(
|
||||
'propel.sql.dir' => $cacheDir
|
||||
|
@ -77,10 +81,9 @@ EOT
|
|||
$fileExt = pathinfo($file->getFilename(), PATHINFO_EXTENSION);
|
||||
$finalLocation = $sqlDir. DIRECTORY_SEPARATOR. $file->getFilename();
|
||||
|
||||
if($fileExt === 'map' && $filesystem->exists($finalLocation)) {
|
||||
if ($fileExt === 'map' && $filesystem->exists($finalLocation)) {
|
||||
$this->mergeMapFiles($finalLocation, (string) $file);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$filesystem->remove($finalLocation);
|
||||
$filesystem->rename((string) $file, $finalLocation);
|
||||
}
|
||||
|
@ -113,10 +116,13 @@ EOT
|
|||
*
|
||||
* @return boolean result
|
||||
*/
|
||||
protected function mergeMapFiles($target, $generated) {
|
||||
protected function mergeMapFiles($target, $generated)
|
||||
{
|
||||
if(($targetContent = file($target)) === false)
|
||||
|
||||
return false;
|
||||
if(($generatedContent = file($generated)) === false)
|
||||
|
||||
return false;
|
||||
|
||||
$targetContent = array_merge($generatedContent, array_diff($targetContent, $generatedContent));
|
||||
|
|
Loading…
Reference in a new issue