Skip to content
Snippets Groups Projects
Commit 5d030e9e authored by jurgenhaas's avatar jurgenhaas
Browse files

Explicitly download scaffold for Drupal core through drupal-composer/drupal-scaffold

parent a0a89a42
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,7 @@ use Composer\IO\IOInterface;
use Composer\Plugin\PluginInterface;
use Composer\Script\Event;
use Composer\Script\ScriptEvents;
use DrupalComposer\DrupalScaffold\Handler as DrupalScaffoldHandler;
/**
* Composer plugin for handling drupal scaffold.
......@@ -21,11 +22,19 @@ class Plugin implements PluginInterface, EventSubscriberInterface {
*/
protected $handler;
/**
* The scaffold handler object for events.
*
* @var \DrupalComposer\DrupalScaffold\Handler
*/
protected $scaffoldHandler;
/**
* {@inheritdoc}
*/
public function activate(Composer $composer, IOInterface $io) {
$this->handler = new Handler($composer, $io);
$this->scaffoldHandler = new DrupalScaffoldHandler($composer, $io);
}
/**
......@@ -34,6 +43,7 @@ class Plugin implements PluginInterface, EventSubscriberInterface {
public static function getSubscribedEvents() {
return array(
ScriptEvents::POST_CREATE_PROJECT_CMD => 'postCreateProject',
ScriptEvents::POST_UPDATE_CMD => 'postUpdate',
);
}
......@@ -44,9 +54,20 @@ class Plugin implements PluginInterface, EventSubscriberInterface {
* The event that triggered the plugin.
*/
public function postCreateProject(Event $event) {
$this->scaffoldHandler->downloadScaffold();
$this->handler->setupLakeDropsProject($event);
}
/**
* Post update event callback.
*
* @param \Composer\Script\Event $event
* The event that triggered the plugin.
*/
public function postUpdate(Event $event) {
$this->scaffoldHandler->downloadScaffold();
}
/**
* Callback to setup the project.
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment