From a739edbdd7565b69b8cca11f71dceacf6162a2f2 Mon Sep 17 00:00:00 2001 From: jurgenhaas <juergen@paragon-es.de> Date: Sat, 9 Jan 2021 11:08:47 +0100 Subject: [PATCH] composer/plugin/ahoy#1 Use filename .ahoy.l3d.yml for commands to be imported --- .ahoy.yml => .ahoy.l3d.yml | 0 .gitignore | 2 ++ README.md | 2 +- src/Handler.php | 7 +++---- 4 files changed, 6 insertions(+), 5 deletions(-) rename .ahoy.yml => .ahoy.l3d.yml (100%) diff --git a/.ahoy.yml b/.ahoy.l3d.yml similarity index 100% rename from .ahoy.yml rename to .ahoy.l3d.yml diff --git a/.gitignore b/.gitignore index b2987a3..80a81fb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ /vendor/ /.env /composer.lock +/.ahoy.l3d +/.ahoy.yml diff --git a/README.md b/README.md index 524d45a..a262dec 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ It currently scans all composer packages with the pattern `lakedrops/*` and coll ## Prepare a LakeDrops plugin for Ahoy -When your comploser plugin should support this Ahoy framework, simply create a file called `.ahoy.yml` in the root of your plugin with content similar to this: +When your comploser plugin should support this Ahoy framework, simply create a file called `.ahoy.l3d.yml` in the root of your plugin with content similar to this: ```yaml ahoyapi: v2 diff --git a/src/Handler.php b/src/Handler.php index 033fd79..741b8a6 100644 --- a/src/Handler.php +++ b/src/Handler.php @@ -3,7 +3,6 @@ namespace LakeDrops\Ahoy; use LakeDrops\Component\Composer\BaseHandler; -use LakeDrops\Component\Composer\Utils; use Symfony\Component\Yaml\Yaml; /** @@ -23,7 +22,7 @@ class Handler extends BaseHandler { /** * Update ahoy scripts of all LakeDrops plugins. */ - public function updateScripts() { + public function updateScripts(): void { $this->init(); // We only do the fancy stuff for developers. @@ -44,8 +43,8 @@ class Handler extends BaseHandler { $installationManager = $this->composer->getInstallationManager(); 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'); + if (file_exists($pluginRoot . '/.ahoy.l3d.yml')) { + $pluginAhoy = Yaml::parseFile($pluginRoot . '/.ahoy.l3d.yml'); foreach ($pluginAhoy['commands'] as $command => $commands) { $ahoy['commands'][$command] = $commands; if (isset($commands['imports']) && is_array($commands['imports'])) { -- GitLab