diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 425525a72c50570b10b444925b9f6dbd0d2981ea..5f9edfe2e0a1a5d29ffc9193ed88e9909df23d36 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,5 +3,5 @@ It is important to use the following command for updates: ```bash -copmoser update --no-plugins +composer update --no-plugins ``` diff --git a/composer.json b/composer.json index 390ff67048119c2e5e3781b1f367f0ebe9eef0ef..30f25a33b906f901a427f7bb19e1dce97dc97564 100644 --- a/composer.json +++ b/composer.json @@ -55,7 +55,7 @@ "drupal/security_review": "1.x-dev", "drupal/stage_file_proxy": "^1.0-alpha3", "drush/drush": "9.0-beta4", - "lakedrops/composer-json-utils": "^0.1", + "lakedrops/composer-scripts": "^0.1", "lakedrops/docker4drupal": "^0.8", "lakedrops/dorgflow": "^0.3" }, @@ -77,10 +77,6 @@ "lakedrops-scaffold": { "callback": "LakeDrops\\Drupal8Scaffold\\Plugin::scaffold", "description": "(Re-)Configure docker for this project." - }, - "lakedrops-scripts": { - "callback": "LakeDrops\\Drupal8Scaffold\\Plugin::scripts", - "description": "(Scan LakeDrops plugins for scripts." } } } diff --git a/src/Handler.php b/src/Handler.php index b1198decf07b2264b4a114a0237c54d1109bfb4c..9a62b333b4959cc472b99aa8aa0dbddcb9c736d1 100644 --- a/src/Handler.php +++ b/src/Handler.php @@ -5,7 +5,6 @@ namespace LakeDrops\Drupal8Scaffold; use Composer\Composer; use Composer\IO\IOInterface; use Composer\Script\Event; -use LakeDrops\Component\Composer\Utils; use LakeDrops\Docker4Drupal\Handler as D4D; use Symfony\Component\Filesystem\Filesystem; @@ -214,37 +213,6 @@ class Handler { } } - /** - * Update scripts of all LakeDrops plugins. - * - * @param \Composer\Script\Event $event - * The event that triggered the plugin. - */ - public function updateScripts(Event $event) { - - // We only do the fancy stuff for developers. - if (!$event->isDevMode()) { - return; - } - - $settings = new Utils($this->composer); - $scripts = $settings->getSection('scripts'); - $scriptDescriptions = $settings->getSubSection('extra', 'scripts-description'); - $installationManager = $this->composer->getInstallationManager(); - foreach ($this->composer->getRepositoryManager()->getLocalRepository()->search('lakedrops/*') as $pkg) { - $pluginRoot = $installationManager->getInstallPath($this->getPackage($pkg['name'])); - $pluginSettings = new Utils($this->composer, $pluginRoot); - foreach ($pluginSettings->getSubSubSection('extra', 'lakedrops', 'scripts') as $name => $script) { - $scripts[$name] = $script['callback']; - $scriptDescriptions[$name] = $script['description']; - } - } - - $settings->setSection('scripts', $scripts); - $settings->setSubSection('extra', 'scripts-description', $scriptDescriptions); - $settings->write(); - } - /** * Retrieve configuration for this package. * diff --git a/src/Plugin.php b/src/Plugin.php index 215152c2e1410b6a7703de2e0f5a277b2f13bcdc..5b132269d5c984b29c6ca74a8c9b3779cb4a847e 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -34,8 +34,6 @@ class Plugin implements PluginInterface, EventSubscriberInterface { public static function getSubscribedEvents() { return array( ScriptEvents::POST_CREATE_PROJECT_CMD => 'postCreateProject', - ScriptEvents::POST_INSTALL_CMD => 'updateScripts', - ScriptEvents::POST_UPDATE_CMD => 'updateScripts', ); } @@ -49,16 +47,6 @@ class Plugin implements PluginInterface, EventSubscriberInterface { $this->handler->setupLakeDropsProject($event); } - /** - * Update scripts of all LakeDrops plugins. - * - * @param \Composer\Script\Event $event - * The event that triggered the plugin. - */ - public function updateScripts(Event $event) { - $this->handler->updateScripts($event); - } - /** * Callback to setup the project. * @@ -70,15 +58,4 @@ class Plugin implements PluginInterface, EventSubscriberInterface { $handler->setupLakeDropsProject($event); } - /** - * Callback to scan plugins for scripts. - * - * @param \Composer\Script\Event $event - * The event that triggered the plugin. - */ - public static function scripts(Event $event) { - $handler = new Handler($event->getComposer(), $event->getIO()); - $handler->updateScripts($event); - } - }