From b77d2d70462ebc2c78175b077c685664c5e686b3 Mon Sep 17 00:00:00 2001
From: jurgenhaas <juergen.haas@lakedrops.com>
Date: Sun, 27 Dec 2020 14:46:35 +0100
Subject: [PATCH] docker/l3d#58 Move project settings out of composer.json

---
 src/Handler.php | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/Handler.php b/src/Handler.php
index 80112d8..033fd79 100644
--- a/src/Handler.php
+++ b/src/Handler.php
@@ -42,14 +42,16 @@ class Handler extends BaseHandler {
     }
 
     $installationManager = $this->composer->getInstallationManager();
-    foreach ($this->composer->getRepositoryManager()->getLocalRepository()->search('*') as $pkg) {
+    foreach ($this->composer->getRepositoryManager()->getLocalRepository()->search('lakedrops/*') as $pkg) {
       $pluginRoot = $installationManager->getInstallPath($this->getPackage($pkg['name']));
       if (file_exists($pluginRoot . '/.ahoy.yml')) {
         $pluginAhoy = Yaml::parseFile($pluginRoot . '/.ahoy.yml');
         foreach ($pluginAhoy['commands'] as $command => $commands) {
           $ahoy['commands'][$command] = $commands;
-          foreach ($commands['imports'] as $key => $import) {
-            $ahoy['commands'][$command]['imports'][$key] = './vendor/' . $pkg['name'] . '/' . $import;
+          if (isset($commands['imports']) && is_array($commands['imports'])) {
+            foreach ($commands['imports'] as $key => $import) {
+              $ahoy['commands'][$command]['imports'][$key] = './vendor/' . $pkg['name'] . '/' . $import;
+            }
           }
         }
       }
-- 
GitLab