Skip to content

Commit 780abbe

Browse files
hjuarez20enzolutions
authored andcommitted
Get one site if it has a target (#350)
1 parent db3fa22 commit 780abbe

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/Utils/ConfigurationManager.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,7 @@ public function readTarget($target)
118118
$site = $exploded[0];
119119
$environment = $exploded[1];
120120
}
121-
122-
$sites = $this->getSites();
121+
$sites = $this->getSites($site);
123122
if (!array_key_exists($site, $sites)) {
124123
return [];
125124
}
@@ -387,9 +386,11 @@ private function importConfigurationFromFile($configFile)
387386
}
388387

389388
/**
389+
* @param string $target
390+
*
390391
* @return array
391392
*/
392-
public function getSites()
393+
public function getSites($target = "*")
393394
{
394395
if ($this->sites) {
395396
return $this->sites;
@@ -403,7 +404,7 @@ public function getSites()
403404

404405
$finder = new Finder();
405406
$finder->in($sitesDirectories);
406-
$finder->name("*.yml");
407+
$finder->name($target.".yml");
407408

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

0 commit comments

Comments
 (0)