elgentos/magento2-composer-quality-patches 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

elgentos/magento2-composer-quality-patches

最新稳定版本:0.1.4

Composer 安装命令:

composer require elgentos/magento2-composer-quality-patches

包简介

Converts Magento's Quality Patches to a JSON format to be used with vaimo/composer-patches

README 文档

README

This extension adds one command: bin/magento elgentos:quality-patches:convert

It generates a composer.quality-patches.json file to use with the vaimo/composer-patches package. It will also add that file to composer.json when it hasn't been set yet, and add a post-update-cmd hook to automatically update the patches file.

This depends on magento/quality-patches and vaimo/composer-patches.

Some patches will give a "Hmm... Ignoring the trailing garbage." warnings, causing the patch to fail. There are two ways to handle this;

  1. Add this to your composer.json to let patches fail without stopping the patching:
{
    "extra": {
        "patcher": {
            "graceful": true
        }
    }
}
  1. Add this to your post-install-cmd to fix the double new lines and run the patcher again:
{
    "scripts": {
        "post-install-cmd": [
            "# Remove double new lines from patches to make vaimo/composer-patches process them correctly",
            "find vendor/magento/quality-patches -type f -name '*.patch' -exec    sed --in-place -e :a -e '/^\\n*$/{$d;N;};/\\n$/ba' {} \\;",
            "# Now run patch:apply again to apply the patches and use --no-scripts to avoid an infinite loop",
            "composer2 patch:apply --no-scripts"
        ]
    }
}

We prefer option 2 because when using option 1, other patches that fail for other reasons will not stop our deployment.

Install & Usage

composer require elgentos/magento2-composer-quality-patches 
bin/magento s:up
bin/magento elgentos:quality-patches:convert
composer patch:apply

Alternative method of automatically applying patches

  1. composer require magento/quality-patches
  2. Add this to your composer.json;
{
    "scripts": {
        "post-install-cmd": [
            "./vendor/bin/magento-patches status | grep 'Not applied' | cut -d ' ' -f2 | xargs --no-run-if-empty ./vendor/bin/magento-patches apply"
        ]
    }
}

统计信息

  • 总下载量: 15.96k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 21
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 21
  • Watchers: 3
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2020-12-06