From 6071eb9f956e04d5ca48a14512aae6a2c163ba9e Mon Sep 17 00:00:00 2001
From: jurgenhaas <juergen@paragon-es.de>
Date: Tue, 30 Oct 2018 18:37:26 +0100
Subject: [PATCH] Fix path to imports Self-support ahoy for easier updates

---
 ahoy.yml        | 5 +++++
 composer.json   | 8 +++++++-
 src/Handler.php | 2 +-
 3 files changed, 13 insertions(+), 2 deletions(-)
 create mode 100644 ahoy.yml

diff --git a/ahoy.yml b/ahoy.yml
new file mode 100644
index 0000000..8fc1be5
--- /dev/null
+++ b/ahoy.yml
@@ -0,0 +1,5 @@
+ahoyapi: v2
+commands:
+  update:
+    cmd: composer ahoy "$@"
+    usage: Update Ahoy setup in project
diff --git a/composer.json b/composer.json
index 4e8dbb7..1ba9cb9 100644
--- a/composer.json
+++ b/composer.json
@@ -48,10 +48,16 @@
         "class": "LakeDrops\\Ahoy\\Plugin",
         "lakedrops": {
             "scripts": {
-                "lakedrops-ahoy": {
+                "ahoy": {
                     "callback": "LakeDrops\\Ahoy\\Plugin::scripts",
                     "description": "Scan LakeDrops plugins for ahoy scripts."
                 }
+            },
+            "ahoy": {
+                "ahoy": {
+                    "usage": "Ahoy",
+                    "imports": ["ahoy.yml"]
+                }
             }
         }
     }
diff --git a/src/Handler.php b/src/Handler.php
index f73d609..b42bb88 100644
--- a/src/Handler.php
+++ b/src/Handler.php
@@ -79,7 +79,7 @@ class Handler {
       foreach ($pluginSettings->getSubSubSection('extra', 'lakedrops', 'ahoy') as $command => $commands) {
         $ahoy['commands'][$command] = [];
         foreach ($commands['imports'] as $key => $import) {
-          $ahoy['commands'][$command]['imports'][$key] = './vendor/lakedrops/' . $pkg['name'] . '/' . $import;
+          $ahoy['commands'][$command]['imports'][$key] = './vendor/' . $pkg['name'] . '/' . $import;
         }
       }
     }
-- 
GitLab