Skip to content

Commit

Permalink
Get one site if it has a target (#350)
Browse files Browse the repository at this point in the history
  • Loading branch information
hjuarez20 authored and enzolutions committed May 20, 2019
1 parent db3fa22 commit 780abbe
Showing 1 changed file with 5 additions and 4 deletions.
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

0 comments on commit 780abbe

Please sign in to comment.