Composer - how to ignore some map files?

流过昼夜 提交于 2019-12-07 09:38:51

问题


I'm using composer in my PHP project. There is a module which maps lots of files into to root directory. This includes files like README.md and CHANGELOG.md and the generation autolod files throws an error:

[ErrorException]                                                                
Target ./README.md already exists (set extra.magento-force to override)

Is there a option to ignore a list of files from the mapping and don't use the override option?


回答1:


I works like this, for example if you want to prevent the pub/.htaccess from being overwritten.

Add this to the composter.json

"extra": {
    "magento-force": "override",
    "magento-deploy-ignore": {
        "*": [
            "/pub/.htaccess"
        ]
    }
}

See here for more information: https://github.com/magento/magento-composer-installer/blob/master/doc/Deploy.md#prevent-single-files-from-deploy

Remark: On upgrading Magento versions (2.2.4 -> 2.2.5) such files still seem to be deleted, so you have to restore them from the VCS



来源:https://stackoverflow.com/questions/33732893/composer-how-to-ignore-some-map-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!