drupal-composer / preserve-paths

A composer plugin for keeping specified files and directories when installing/updating new composer packages. Can be used to supported nested packages.
28 stars 28 forks source link

Make it possible to set preserve-paths in dependency extras. #22

Open tobbexiv opened 7 years ago

tobbexiv commented 7 years ago

Issue: I use a CMS which uses composer for extension management. In this implementation sometimes only the package name is known. Therefore the installed package is always wrapped in a new root package which has the package to install as dependency. Unfortunately this root package has none of the extra my package has and I can not change it. Therefore I can not use this plugin at the moment.

Solution: Make it possible to get the preserve paths from the dependencies. To ensure that this causes no new issues, I added two new options. A package has to declare that his preserve paths should be read if it is used as dependency (preserve-paths-as-dependency). Additionally anyone who uses your plugin can override this behavior in your root package by setting preserve-paths-ignore-dependencies to true. In this case no information will be read for any of the dependencies.

I would be glad if you could include this, but it would also be ok for me if you decide that this is too specific and you do not want to have this change.

derhasi commented 6 years ago

Sorry for not responding in this PR for such a long time. Put currently I don't fully grasp the implications of these changes, therefore I can't decide on it right now.