From d9e35de7c02dabad461cae565b3a28adf1595642 Mon Sep 17 00:00:00 2001 From: Justin Winter Date: Fri, 17 Mar 2017 14:35:56 -0400 Subject: [PATCH] Documenting post-drupal-scaffold-cmd to applying patches Plus minor grammer change to "Contributing.md" : are -> our Signed-off-by: Justin Winter --- CONTRIBUTING.md | 2 +- template/patches/README.md | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7c1c2497f..ad089df89 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -49,7 +49,7 @@ The new `blt-project` directory will have a composer dependency on your local cl While Phing and the Symfony Console can both accomplish some of the same tasks, they are different tools with different intended purposes. When developing functionality for BLT we are careful to choose the right tool for the right job. -Phing is intended to be a build tool. It is particularly good at stringing together multiple commands and tasks into a single target which can then be executed procedurally. We use Phing when are requirements are well suited to this strength. +Phing is intended to be a build tool. It is particularly good at stringing together multiple commands and tasks into a single target which can then be executed procedurally. We use Phing when our requirements are well suited to this strength. The commands that Phing executes can, of course, be provided by anything. Some are native linux commands, some are provided by tools like Composer and NPM, while others may be provided by the Symfony Console component. diff --git a/template/patches/README.md b/template/patches/README.md index fc234d6eb..8da918b63 100644 --- a/template/patches/README.md +++ b/template/patches/README.md @@ -34,7 +34,7 @@ Examples: ## Gotchas -Note that Composer can only patch files that are distributed with Composer packages. This means that certain files (such as the Drupal core `.htaccess` and `robots.txt`) cannot be patched via Composer, since they are not included in the Drupal core Composer package (in fact Drupal Scaffold individually creates these files on updates). +Note that Composer can only patch files that are distributed with Composer packages. This means that certain files (such as the Drupal core `.htaccess` and `robots.txt`) cannot be easily patched via Composer. These files are not included in the Drupal core Composer package (in fact Drupal Scaffold individually creates these files on updates). In order to modify `.htaccess` and other unpatchable root files, simply modify the file in place, commit it to Git, and make the following change in `composer.json`: @@ -46,4 +46,10 @@ In order to modify `.htaccess` and other unpatchable root files, simply modify t } }, +The downside here is that you will need to apply drupal core udpates to these excluded files on your own. + +Alternatively, you could leverage the `post-drupal-scaffold-cmd` script hook to apply patches after Drupal Scaffold is finished. See the following issue for more details: https://github.com/acquia/blt/issues/1135#issuecomment-285404408 + + + Also note that there’s currently a quirk in the Drupal packaging system that makes it difficult to patch module and theme `.info.yml` files. If you have trouble applying a patch that modifies an info file, see this issue for a description and workaround: https://www.drupal.org/node/2858245