There is a specialized fix to a contrib theme that I am trying to apply. Because this theme is in the .gitignore file, it's incumbent upon me to generate a patch that composer can include. Please note that the dependency "cweagans/composer-patches" is required. Pantheon is using the composer.lock file and I cannot get composer update
to find the target file. I built the patch file using diff and modified its headers like other successful Drupal patches. In composer.json
"patchLevel": {
"drupal/core": "-p2",
"drupal/dxpr_theme": "-p1"
},
"enable-patching": "true",
"patches": {
"drupal/dxpr_theme": {
"header patch": "./patches/header.patch"
}
and the headers of header.patch
index fakehash..fakehash1 100644
--- a/js/dist/dxpr-theme-header.js
+++ b/js/dist/dxpr-theme-header.js
@@ -4,7 +4,7 @@
Since there is no git commit with this theme I faked a couple of hashes but left the line in, thx for the comment @Clive.
Ensuring that in context of this theme folder I was able to successfully run the patch using
patch -p1 < ../../../../patches/header.patch
In context of the Drupal project I ran:
composer --verbose update ---lock
Applying patches for drupal/dxpr_theme
./patches/header.patch (header patch) patch '-p1' --no-backup-if-mismatch -d 'web/themes/contrib/dxpr_theme' < '/Users/sam/apps/myproject/patches/header.patch' patching file
js/dist/dxpr-theme-header.js Reversed (or previously applied) patch
detected! Assume -R? [n] Apply anyway? [n] Skipping patch.
What's curious is that the file is updated but I find no evidence in composer.lock. Perhaps it is and I don't know how it's indicated? I have removed any file with .rej, .orig and reset the target file to before any patch attempts. Same state as my successful attempt at patch by itself, apart from composer.
As mentioned, if I can get composer to update this file after patching I can then see if the composer.lock file is applying this patch.