From 780abbe8d4ae12756d68f5ef033d420452591438 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harold=20Ju=C3=A1rez?= Date: Mon, 20 May 2019 13:23:27 -0600 Subject: [PATCH] Get one site if it has a target (#350) --- src/Utils/ConfigurationManager.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Utils/ConfigurationManager.php b/src/Utils/ConfigurationManager.php index 0e8dd94..98aaebe 100644 --- a/src/Utils/ConfigurationManager.php +++ b/src/Utils/ConfigurationManager.php @@ -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 []; } @@ -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; @@ -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');