cweagans / composer-configurable-plugin

Provides a lightweight configuration system for Composer plugins.
BSD 3-Clause "New" or "Revised" License
9 stars 1 forks source link

Issue if trying to patch file with CRLF line ending #2

Closed mamsincl closed 4 years ago

mamsincl commented 4 years ago

Hi cweagans,

Recently just faced with issue stated in the title. The file I wanted to patch is using Windows standard new line characters (\r\n or CRLS). The main problem, that patch command itself stripping trailing CRs from patch so I am continuously getting different line endings error messages. To prevent this we can use --binary switch on patch command, but as automated deployment, if I am patching your Patches class, that only will be available of the next run only ... and have to re-patch your patcher every time so the patching will failing over and over again.

Could be possible to add a settings/switch to composer.patch.json to use --binary option during patch ... something like

{
  "patches": {
    "magento/module-email": {
      "https://github.com/magento/magento2/pull/22469": "patches/vendor/magento/module-email/Model/Template.php.patch",
      "settings": [ 
          "binary": true/false(default if not present)
      ]
    }
  }
}

Thanks, Robert Szeker aka Mammouth

mamsincl commented 4 years ago

sorry wrong repo