symfony / recipes

Symfony Recipes Repository
https://github.com/symfony/recipes/blob/flex/main/RECIPES.md
MIT License
953 stars 472 forks source link

Doc/Manifest - how to specify options['force'] for CopyFromPackage section #1321

Closed dreamworks closed 1 month ago

dreamworks commented 1 month ago

Hi,

apologize if this is the wrong place, and pl. reroute me, where to proceed with this issue. I have an issue with "copy-from-package" section within an recipe manifest.. I need to overwrite an existing fils (deployed from an required package) by a specific file within my bundle.

Digging down the source I found the $options['force'] setting (line 127 in CopyFromPackageConfigurator) but I do not find any example/hint where/how to set this option within the manifest in the recipe.

Can anyone bring some light in here?

Best reagards & many thx

nicolas-grekas commented 1 month ago

Hi, the force option is only used by some commands, you cannot use it in your manifests. You cannot override an existing file with a recipe. I think what might work for you is using a symfony-pack (like https://github.com/symfony/test-pack/blob/main/composer.json) Those can have recipes that run before any other recipes, so that they have priority to write a file.