Skip to content

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

@mamsincl

Description

@mamsincl

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions