Check if build artifacts exist before deleting them
This commit is contained in:
parent
3739df7186
commit
69cc83a04a
1 changed files with 15 additions and 6 deletions
|
|
@ -68,11 +68,7 @@ class Pdepend implements \PHPCI\Plugin
|
|||
|
||||
$cmd = PHPCI_BIN_DIR . 'pdepend --summary-xml=%s --jdepend-chart=%s --overview-pyramid=%s "%s"';
|
||||
|
||||
//Remove the created files first
|
||||
unlink($this->location . DIRECTORY_SEPARATOR . $this->summary);
|
||||
unlink($this->location . DIRECTORY_SEPARATOR . $this->chart);
|
||||
unlink($this->location . DIRECTORY_SEPARATOR . $this->pyramid);
|
||||
|
||||
$this->removeBuildArtifacts();
|
||||
$success = $this->phpci->executeCommand(
|
||||
$cmd,
|
||||
$this->location . DIRECTORY_SEPARATOR . $this->summary,
|
||||
|
|
@ -101,4 +97,17 @@ class Pdepend implements \PHPCI\Plugin
|
|||
|
||||
return $success;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove files created from previous builds
|
||||
*/
|
||||
protected function removeBuildArtifacts()
|
||||
{
|
||||
//Remove the created files first
|
||||
foreach (array($this->summary, $this->chart, $this->pyramid) as $file) {
|
||||
if (file_exists($this->location . DIRECTORY_SEPARATOR . $file)) {
|
||||
unlink($this->location . DIRECTORY_SEPARATOR . $file);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue