From 770e7fe64c7efa009168694947b2873280c2ae6d Mon Sep 17 00:00:00 2001 From: Augustas Berneckas Date: Wed, 19 Sep 2018 11:37:58 +0300 Subject: [PATCH] In `ReplaceFilesStep` provide custom Iterator to skip VCS files removal --- CHANGELOG.md | 4 ++++ .../Service/ReleaseStep/ReplaceFilesStep.php | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e50b22b..da34f83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## 10.4.3 +### Fixed +- In `ReplaceFilesStep` provide custom Iterator to skip VCS files removal. + ## 10.4.2 ### Fixed - Fixed `file not found` warning when creating new package. diff --git a/src/Paysera/Bundle/ClientReleaseBundle/Service/ReleaseStep/ReplaceFilesStep.php b/src/Paysera/Bundle/ClientReleaseBundle/Service/ReleaseStep/ReplaceFilesStep.php index c0d2e18..4bc18e5 100644 --- a/src/Paysera/Bundle/ClientReleaseBundle/Service/ReleaseStep/ReplaceFilesStep.php +++ b/src/Paysera/Bundle/ClientReleaseBundle/Service/ReleaseStep/ReplaceFilesStep.php @@ -7,6 +7,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Filesystem\Filesystem; +use Symfony\Component\Finder\Finder; class ReplaceFilesStep implements ReleaseStepInterface { @@ -21,10 +22,15 @@ public function processStep(ReleaseStepData $releaseStepData, InputInterface $in { $output->writeln(sprintf('* Mirroring generated files to source repository...')); + $iterator = Finder::create() + ->in($releaseStepData->getSourceDir()) + ->getIterator() + ; + $this->filesystem->mirror( $releaseStepData->getGeneratedDir(), $releaseStepData->getSourceDir(), - null, + $iterator, [ 'delete' => true, 'override' => true,