Merge pull request #788 from camilstaps/fix-391-directory-structure-is-ignored

Fix #391: directory structure is ignored
This commit is contained in:
Klaus Silveira
2018-06-09 18:47:38 -04:00
committed by GitHub

View File

@@ -157,7 +157,7 @@ class Client extends BaseClient
return $this; return $this;
} }
private function recurseDirectory($path, $topLevel = true) private function recurseDirectory($path, $appendPath = '')
{ {
$dir = new \DirectoryIterator($path); $dir = new \DirectoryIterator($path);
@@ -209,11 +209,7 @@ class Client extends BaseClient
$description = null; $description = null;
} }
if (!$topLevel) { $repoName = $appendPath . $file->getFilename();
$repoName = $file->getPathInfo()->getFilename() . '/' . $file->getFilename();
} else {
$repoName = $file->getFilename();
}
if (is_array($this->getProjects()) && !in_array($repoName, $this->getProjects())) { if (is_array($this->getProjects()) && !in_array($repoName, $this->getProjects())) {
continue; continue;
@@ -227,7 +223,7 @@ class Client extends BaseClient
continue; continue;
} }
$repositories = array_merge($repositories, $this->recurseDirectory($file->getPathname(), false)); $repositories = array_merge($repositories, $this->recurseDirectory($file->getPathname(), $appendPath . $file->getFilename() . '/'));
} }
} }