Skip to content

Commit

Permalink
Pass the entire Composer event to the downloadScaffold method.
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorentTorregrosa committed Oct 7, 2017
1 parent df490fc commit 5364fbd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function onPostCmdEvent(\Composer\Script\Event $event) {
// Only install the scaffolding if drupal/core was installed,
// AND there are no scaffolding files present.
if (isset($this->drupalCorePackage)) {
$this->downloadScaffold($event->isDevMode());
$this->downloadScaffold($event);
// Generate the autoload.php file after generating the scaffold files.
$this->generateAutoload();
}
Expand All @@ -97,18 +97,18 @@ public function onPostCmdEvent(\Composer\Script\Event $event) {
/**
* Downloads drupal scaffold files for the current process.
*
* @param bool $dev
* TRUE if dev packages are installed. FALSE otherwise.
* @param \Composer\Script\Event $event
* The Composer event.
*/
public function downloadScaffold($dev = FALSE) {
public function downloadScaffold($event) {
$drupalCorePackage = $this->getDrupalCorePackage();
$webroot = realpath($this->getWebRoot());

// Collect options, excludes, dev and settings files.
$options = $this->getOptions();
$includes = $this->getIncludes();
// Check dev files if necessary.
if ($dev) {
if ($event->isDevMode()) {
$includes = array_merge($includes, $this->getIncludesDev());
}
$files = array_diff($includes, $this->getExcludes());
Expand Down
2 changes: 1 addition & 1 deletion src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function postCmd(\Composer\Script\Event $event) {
*/
public static function scaffold(\Composer\Script\Event $event) {
$handler = new Handler($event->getComposer(), $event->getIO());
$handler->downloadScaffold($event->isDevMode());
$handler->downloadScaffold($event);
// Generate the autoload.php file after generating the scaffold files.
$handler->generateAutoload();
}
Expand Down

0 comments on commit 5364fbd

Please sign in to comment.