Skip to content

Conversation

@webflo
Copy link
Member

@webflo webflo commented May 25, 2016

No description provided.

This was referenced May 25, 2016
@webflo webflo force-pushed the drupal-scaffold branch from e9e0823 to bff2736 Compare May 25, 2016 22:10
@webflo webflo merged commit 719a188 into 8.x May 25, 2016
@webflo webflo deleted the drupal-scaffold branch May 25, 2016 22:41
@q0rban
Copy link

q0rban commented Dec 13, 2017

I've been going down quite the rabbit hole to figure out what drupal-composer/drupal-scaffold is doing in drupal-project. So, it used to actually run as a part of post-install and post-update, but looks like with this PR, it no longer does that. Is that correct? Now it seems you have to run it by hand if you want it to get called. Is that intentional? If so, should we document why it's in the repo, and when someone should use it?

Here's a test I ran on a fresh install of drupal-project.

$ ls web/sites/default/default.settings.php
web/sites/default/default.settings.php
$ rm web/sites/default/default.settings.php
$ composer install
> DrupalProject\composer\ScriptHandler::checkComposerVersion
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
Removing packages services cache file:
drupal-project/vendor/drupal/console/extend.console.uninstall.services.yml
Creating packages services cache file:
drupal-project/vendor/drupal/console/extend.console.uninstall.services.yml
> DrupalProject\composer\ScriptHandler::createRequiredFiles
$ ls web/sites/default/default.settings.php
ls: web/sites/default/default.settings.php: No such file or directory

Then if I add composer drupal-scaffold to post-install-cmd:

$ ls web/sites/default/default.settings.php
ls: web/sites/default/default.settings.php: No such file or directory
$ composer install
> DrupalProject\composer\ScriptHandler::checkComposerVersion
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
Removing packages services cache file:
drupal-project/vendor/drupal/console/extend.console.uninstall.services.yml
Creating packages services cache file:
drupal-project/vendor/drupal/console/extend.console.uninstall.services.yml
> composer drupal-scaffold
> DrupalComposer\DrupalScaffold\Plugin::scaffold
Downloading (100%)Downloading (100%)Downloading (100%)Downloading (100%)Downloading (100%)Downloading (100%)Downloading (100%)Downloading (100%)Downloading (100%)Downloading (100%)Downloading (100%)Downloading (100%)Downloading (100%)Downloading (100%)Downloading (100%)> DrupalProject\composer\ScriptHandler::createRequiredFiles
$ ls web/sites/default/default.settings.php
web/sites/default/default.settings.php

@q0rban
Copy link

q0rban commented Dec 14, 2017

Ok, I think I understand now—drupal-scaffold gets run automatically during create-project or if you use composer require to get a new version of drupal/core. It doesn't run during install or update unless you specifically tell it to in your composer.json, as denoted in the README. That's a departure from how it worked prior to this PR, but it makes sense now. Thanks for listening. ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants