Skip to content

Commit

Permalink
Merge pull request #108 from php-etl/fix/clear-workflow-pipelines
Browse files Browse the repository at this point in the history
delete old pipelines when building a workflow
  • Loading branch information
gplanchat authored Jun 8, 2023
2 parents 57b0c17 + a94306c commit de4b3a3
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Adapter/Filesystem/SatelliteBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,21 @@ public function build(): Configurator\SatelliteInterface

$satellite->dependsOn(...$this->composerRequire);

$this->clearPipelines();

return $satellite;
}

private function clearPipelines(): void
{
$iterator = new \AppendIterator();

$iterator->append(new \GlobIterator($this->workdir.'/pipeline*.php', \FilesystemIterator::CURRENT_AS_FILEINFO | \FilesystemIterator::SKIP_DOTS));

foreach ($iterator as $file) {
if (is_file($file->getPathname())) {
unlink($file->getPathname());
}
}
}
}

0 comments on commit de4b3a3

Please sign in to comment.