Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get one site if it has a target #350

Merged
merged 1 commit into from
May 20, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/Utils/ConfigurationManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ public function readTarget($target)
$site = $exploded[0];
$environment = $exploded[1];
}

$sites = $this->getSites();
$sites = $this->getSites($site);
if (!array_key_exists($site, $sites)) {
return [];
}
Expand Down Expand Up @@ -387,9 +386,11 @@ private function importConfigurationFromFile($configFile)
}

/**
* @param string $target
*
* @return array
*/
public function getSites()
public function getSites($target = "*")
{
if ($this->sites) {
return $this->sites;
Expand All @@ -403,7 +404,7 @@ public function getSites()

$finder = new Finder();
$finder->in($sitesDirectories);
$finder->name("*.yml");
$finder->name($target.".yml");

foreach ($finder as $site) {
$siteName = $site->getBasename('.yml');
Expand Down