Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Composer - how to ignore some map files?

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?

like image 614
Marvin Caspar Avatar asked Nov 16 '15 10:11

Marvin Caspar


1 Answers

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

like image 139
Alex Avatar answered Oct 23 '22 13:10

Alex