1
0
Fork 0

Fix deletion of vcs dirs, fixes #1260

pull/1266/merge
Jordi Boggiano 2012-10-26 00:19:28 +02:00
parent 711179b2b4
commit 85bbf99817
1 changed files with 4 additions and 2 deletions

View File

@ -203,14 +203,16 @@ EOT
)
) {
$finder = new Finder();
$finder->depth(1)->directories()->in(getcwd())->ignoreVCS(false)->ignoreDotFiles(false);
$finder->depth(0)->directories()->in(getcwd())->ignoreVCS(false)->ignoreDotFiles(false);
foreach (array('.svn', '_svn', 'CVS', '_darcs', '.arch-params', '.monotone', '.bzr', '.git', '.hg') as $vcsName) {
$finder->name($vcsName);
}
try {
$fs = new Filesystem();
foreach (iterator_to_array($finder) as $dir) {
$dirs = iterator_to_array($finder);
unset($finder);
foreach ($dirs as $dir) {
if (!$fs->removeDirectory($dir)) {
throw new \RuntimeException('Could not remove '.$dir);
}